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.
repeat until not is bad
use repeat wait() until not
it has the same concept of while true do, if there is no wait()/thread yielding function, it will crash