I wanna return humanoid’s previous walkspeed but when I do that, it returns 0…
also this script clones and goes to player’s character, it also checks if theres no script.
I might sound stupid but it really makes me upset and confuses…
local chr = script.Character.Value --object value
local hum = chr.Humanoid --humanoid
local ws = {}
local js = {}
--walkspeed and jumppower tables
ws[chr.Name] = hum.WalkSpeed
js[chr.Name] = hum.JumpPower
--gettin previous walkspeed and jumppower
print(" "..chr.Name.." "..hum.WalkSpeed.." "..hum.JumpPower)
hum.WalkSpeed = 0
hum.JumpPower = 0
--sets to 0 so player cant move
print(" "..chr.Name.." "..hum.WalkSpeed.." "..hum.JumpPower)
wait(script.Time.Value)
--waits certains time (usually 2)
hum.WalkSpeed = ws[chr.Name]
hum.JumpPower = js[chr.Name]
--sets walk speed and jump power
print(""..chr.Name.." "..hum.WalkSpeed.." "..hum.JumpPower)
wait()
script:Destroy()
i think its because it clones a lot in combat but idk how to even fix it