Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i make status effects like stun?

Asked by 6 years ago

Is it possible to create a function that stuns the player when they take damage?

0
yes its possible green271 635 — 6y
0
yes, just set their walkspeed to 0 or near 0 theking48989987 2147 — 6y
0
Or enable PlatformStand in Humanoid's properties hellmatic 1523 — 6y

2 answers

Log in to vote
0
Answered by
AIphanium 124
6 years ago
Edited 6 years ago

Hello, eze123456!

I'm providing you a script because... you deserve it.

01--LocalScript
02-- Place it in the starterpack.
03 
04player = game.Players.LocalPlayer -- First, we get the LocalPlayer
05 
06used = false
07 
08anim = script.Animation -- Note : You have to make an animation inside roblox's Animation Plugin, then you have to create an Animation Object inside this script (not plugin),
09--MAKE SURE to get the Id.
10 
11hum = player.Character.Humanoid
12 
13animTrack = hum:LoadAnimation(anim)
14 
15player.Character.Humanoid.HealthChanged:Connect(function() -- This, is a Function, it only works when the player's health changes!
View all 33 lines...
0
thanks but how could i add a stunned animation though? EzireBlueFlame 14 — 6y
0
Edited my answer, accept it so we both get reputation. AIphanium 124 — 6y
Ad
Log in to vote
1
Answered by
Tizzel40 243 Moderation Voter
6 years ago
Edited 6 years ago

Yes its possible

there's is many ways you can do it!

you could insert a Bool Value inside your character and make it false and name it "StunValue"

then you could add a script to make it if the bool value changed to true then it will set your walkspeed to 0 or enable platform stand like unsatisfied_d said.

Answer this question