Here you can find answered ScriptAPI topics.
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Fri Aug 12, 2016 8:28 am
I need a script that sets start equipment to a pillow and doesn't allow to change weapons.
If a player throws a pillow, he cant attack until he grabs another one.
Pls tell me if you got any questions
PS.: you will get a small shiny credit in my map
| ! | Message from: KliPeH |
The poster was issued a warning for breaking the following forum rule:
Rule #10 - Post descriptive topic titles. |
EDIT: The player should be able to attack while holding a pillow, otherwise he might deal no damage or something like that.
Last edited by
Billy on Fri Aug 12, 2016 5:05 pm, edited 1 time in total.
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...
-
Creeper
- Superfighter

- Posts: 172
- Joined: Wed Mar 23, 2016 9:44 am
- Title: okokok is real #1
- SFD Account: Krypa
- SFD Alias: Krypa
- Started SFD: Pre-Alpha 1.1.6
- Location: US
- Gender:
- Age: 23
-
Contact:
Post
by Creeper » Fri Aug 12, 2016 10:44 am
One thing with the throwing thing, You can only freeze them, Soooo they "Can't" melee, But they cant move. So this is a big problem for you.
And if you make them get the pillow, when the they threw it, Its going to be realy unbalanced for others.
I don't think that there is a script for disabling melee and the player could still move.
But im not a script professionalist so you can wait until a different scripter comes here and tells you what to do. :3
0 x
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Sat Aug 13, 2016 3:28 pm
Off Topic
I need the script really badly(this text is in a offtopic bubble cause i cant get banned for comments in those little useful helpers

)
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...
-
JakSparro98
- Superfighter

- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 27
Post
by JakSparro98 » Sun Aug 14, 2016 3:33 pm
Billy wrote:I need a script that sets start equipment to a pillow and doesn't allow to change weapons.
If a player throws a pillow, he cant attack until he grabs another one.
Pls tell me if you got any questions
PS.: you will get a small shiny credit in my map
| ! | Message from: KliPeH |
The poster was issued a warning for breaking the following forum rule:
Rule #10 - Post descriptive topic titles. |
EDIT: The player should be able to attack while holding a pillow, otherwise he might deal no damage or something like that.
As how I have understood the script do these operations:
- • Assign pillows at start, when dropped and don't allow the player to use other weapons, but powerups still works.
• fists aren't selectable.
• kicks don't hurts but fall damage caused by flying kicks still do.
If you need other tweaks let me know.
1 x
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Sun Aug 14, 2016 6:15 pm
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...
-
JakSparro98
- Superfighter

- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 27
Post
by JakSparro98 » Sun Aug 14, 2016 6:50 pm
Here's to you:
Code: Select all
Events.UpdateCallback m_updateEvent = null;
int[] playersUID=new int[8];
int index=0;
public void OnStartup() {
m_updateEvent = Events.UpdateCallback.Start(PillowScript, 0);
}
public void PillowScript(float elapsed) {
foreach(IObject destroyer in Game.GetObjectsByName("Pillow00"))
if(!destroyer.IsMissile)
destroyer.Remove();
foreach(IPlayer pl in Game.GetPlayers())
{
if(!pl.IsBot)
{
if(pl.CurrentWeaponDrawn.ToString()!="Melee" || pl.CurrentMeleeMakeshiftWeapon.WeaponItem.ToString() !="PILLOW")
if((pl.IsIdle && !pl.IsRolling)|| pl.IsMeleeAttacking || pl.IsDrawingWeapon)
pl.GiveWeaponItem(WeaponItem.PILLOW);
}
if(pl.IsStaggering &&!playersUID.Contains(pl.UniqueID))
{
playersUID[index]=pl.UniqueID;
index++;
pl.SetHealth(pl.GetHealth()+3);
}
if(!pl.IsLayingOnGround && !pl.IsStaggering && playersUID.Contains(pl.UniqueID)&& !pl.IsFalling)
playersUID[Array.IndexOf(playersUID,pl.UniqueID)]=0;
if(index>=7)
index=0;
}
}
You don't need to place triggers to get this to work, It will run at the map startup.
Last edited by
JakSparro98 on Fri Aug 19, 2016 12:23 pm, edited 3 times in total.
2 x
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Mon Aug 15, 2016 3:46 pm
Added in 6 hours 16 minutes 6 seconds:
i found a bug in the script, if you get stunned you spawn a constant stream of pillows
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...
-
JakSparro98
- Superfighter

- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 27
Post
by JakSparro98 » Mon Aug 15, 2016 4:23 pm
Billy wrote:
Added in 6 hours 16 minutes 6 seconds:
i found a bug in the script, if you get stunned you spawn a constant stream of pillows
Fixed, I've updated the code above.
0 x
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Tue Aug 16, 2016 5:17 pm
Ok, you will get two credits
Added in 23 hours 28 minutes 50 seconds:
you said if i nnedd other changes, i should let you know.
I also need the aspect to don't be able to select ANY other weapon then pillows.(ya will get credit no' 4)
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...
-
JakSparro98
- Superfighter

- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 27
Post
by JakSparro98 » Tue Aug 16, 2016 9:04 pm
Billy wrote:Ok, you will get two credits
Added in 23 hours 28 minutes 50 seconds:
you said if i nnedd other changes, i should let you know.
I also need the aspect to don't be able to select ANY other weapon then pillows.(ya will get credit no' 4)
I didn't understand what you asked, you want to collect weapons but don't be able to select instead of removing them from the inventory?
0 x
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Wed Aug 17, 2016 8:52 am
Removing is also a good idea, but if the script includes that, it doesn't work.
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...
-
JakSparro98
- Superfighter

- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 27
Post
by JakSparro98 » Wed Aug 17, 2016 12:05 pm
Ok now you collect weapons but you cannot use them.
1 x
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Fri Aug 19, 2016 9:53 am
sorry i have to annoy you again: what about melee weapons? they still deal damage...
doo you need one more credit for that?
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...
-
JakSparro98
- Superfighter

- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 27
Post
by JakSparro98 » Fri Aug 19, 2016 12:26 pm
Billy wrote:sorry i have to annoy you again: what about melee weapons? they still deal damage...
doo you need one more credit for that?
No problem, you don't need to credit me (if credit means that you write my name in your maps' developers) each time you tell me to correct the code, one time is enough.
Also thanks for this reports, I fixed this.
1 x
-
Motto73
- Superfighter

- Posts: 316
- Joined: Mon May 09, 2016 7:35 am
- Title: Lazy ass
- SFD Account: Motto73
- Started SFD: Multiplayer Test Demo
- Location: Sunny City
- Gender:
- Age: 26
Post
by Motto73 » Fri Aug 26, 2016 9:52 am
JakSparro98 wrote:Billy wrote:sorry i have to annoy you again: what about melee weapons? they still deal damage...
doo you need one more credit for that?
No problem, you don't need to credit me (if credit means that you write my name in your maps' developers) each time you tell me to correct the code, one time is enough.
Also thanks for this reports, I fixed this.
For me that is
zero.
0 x
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Fri Aug 26, 2016 4:22 pm
I know, Motto, but i got a script from HIM first so... I will might ask both of you in the future and see who deliveres a better one.
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...
-
Motto73
- Superfighter

- Posts: 316
- Joined: Mon May 09, 2016 7:35 am
- Title: Lazy ass
- SFD Account: Motto73
- Started SFD: Multiplayer Test Demo
- Location: Sunny City
- Gender:
- Age: 26
Post
by Motto73 » Mon Aug 29, 2016 1:38 pm
Billy wrote:I know, Motto, but i got a script from HIM first so... I will might ask both of you in the future and see who deliveres a better one.
I said that for Jack actually.
Billy wrote:... and see who deliveres a better one.
You think that we are some kind of pizza deliveries???
Of course we are helping to improve the game and the community. But you can't take us for granted.
2 x
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Tue Aug 30, 2016 9:03 pm
I know, but well... in my country "delivers" is just a therm you can use for everything whithout any "rules" like in english, cause there is not an other word for it, so SORRY
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...
-
JakSparro98
- Superfighter

- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 27
Post
by JakSparro98 » Tue Aug 30, 2016 9:51 pm
Motto73 wrote:JakSparro98 wrote:Billy wrote:sorry i have to annoy you again: what about melee weapons? they still deal damage...
doo you need one more credit for that?
No problem, you don't need to credit me (if credit means that you write my name in your maps' developers) each time you tell me to correct the code, one time is enough.
Also thanks for this reports, I fixed this.
For me that is
zero.
Yeah, this won't change my life but if he wanted to credit me...well, one time because more times doesn't make sense, even nothing but he's free to do all he want.
0 x
-
Billy
- Superfighter

- Posts: 285
- Joined: Fri Apr 22, 2016 3:56 pm
- Title: Owner of a failed Clan
- SFD Account: Billy
- SFD Alias: Billy
- Started SFD: October 2015
- Location: Austria
- Gender:
- Age: 24
Post
by Billy » Wed Aug 31, 2016 8:13 am
No, you only got two credits cause you dont need more than one: one nexg to my name and one is hidden
0 x
Join Delta Squad today, if you mail me now you will get this cool private rank for FREE, but thats not all, you will also get an imaginary Cookie, so better hurry up!
Yea, ehh, that was a big fail...