wait(1) game.Players.LocalPlayer.Character.Stun=Remove() wait() game.Players.LocalPlayer.Character.Stun=Remove()
Any ideas guys? also it doesnt delete the following "Stun" can some one tell me what is the right code for it?
To use the Remove function
, you use : after the thing you want to Remove.
Remove is deprecated
, and you should be using Destroy()
.
wait(1) game.Players.LocalPlayer.Character.Stun:Destroy() wait() game.Players.LocalPlayer.Character.Stun:Destroy()
Only Local Scripts
can access Local Player
.
-- Inside a Local Script wait(1) game.Players.LocalPlayer.Character.Stun:Destroy() wait() game.Players.LocalPlayer.Character.Stun:Destroy()
If you want to continuously Destroy the Stun, use a while loop
.
while wait(0.1) do game.Players.LocalPlayer.Character.Stun:Destroy() end
Also, use variables,
-- Local Script in StarterPack or StarterGui local plr = game.Players.LocalPlayer local char = plr.Character or plr.CharacterAdded:wait() local Stun = char:WaitForChild("Stun")-- edit while wait(0.1) do Stun:Destroy() end
Hope I helped.
Good Luck!