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

Script not running after wait() for no reason. Any reasons why?

Asked by
EzioEE -2
4 years ago

Hello I am making a stunlock system for my roblox game, I have tried 2 different ways Way 1. Was running a function in a module

function module.stun(HIT)
        print(HIT.Stun.Value)
        HIT.Humanoid.WalkSpeed = 0
        HIT.Humanoid.JumpPower = 0
        HIT.Stun.Value = true
        print("stun2")
        wait(0.3)
        print("stun")
            HIT.Humanoid.WalkSpeed = 10
            HIT.Humanoid.JumpPower = 50
            HIT.Stun.Value = false
            print(HIT.Stun.Value)
end

It DOES print "stun2" and the first stun value but it does not print "stun" or second stun.value

Way 2. Was in a server script,

                            coroutine.wrap(function()
                                eneH.Parent.Stun.Value = true
                                print("poop2")
                                    wait(0.4)
                                print("poop")
                                eneH.Parent.Stun.Value = false
                            end)()
                        end

It prints poop2 but not poop there are no errors in the output.

0
what kind of variable is poop2 and poop no offense emervise 123 — 4y
0
haha I just name my variables weird stuff all the time EzioEE -2 — 4y
0
By any chance, are you using getfenv()? Does anything in the script assign `print` or `wait`? gskw 1046 — 4y
0
nope I don't EzioEE -2 — 4y

Answer this question