Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My game keeps crashing when this loop is ran by pressing E? Please help!

Hello, A piece of code of mine is constantly crashing, so how would I prevent that? Any help is greatly appreciated.

local UIS = game:GetService("UserInputService")
local NameofBooleanHere = false
UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.E then
        NameofBooleanHere = true
        wait(0.1)
        repeat until not NameofBooleanHere
            wait(0.1)
            Player.Character.Humanoid:LoadAnimation(aim):Play()
            meleeing = false
            tool.GripForward = Vector3.new(-0.1, 0, -0.9)
            tool.GripRight = Vector3.new(0.9, 0, -0.1)
            aiming = false
    end
end)

How do I make this NOT crash?

Thanks, Rook.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.