I am making an admin and I want to know how I can make it wait to run the code when the user presses ok.
function amount()
script.Parent.Parent.amount.Visible = true
script.Parent.Parent.amount.OK.MouseButton1Click:Connect(function()
script.Parent.Parent.amount.Visible = false
number = tonumber(script.Parent.Parent.amount.input.Text)
end)
end
function commands()
local cmd = script.Parent.Parent.bar.Text
if cmd == "cmds" then
print("commands: \n cmds \n test")
elseif cmd == "test" then
amount()
for i=1,number do
print("hi")
wait(0)
end
end
end
script.Parent.MouseButton1Click:Connect(commands)

2 comments
Thank you! It works now.
Please mark the answer as accepted