wait () while true do wait () script.Parent.InputBox.InputEnded:Connect(function () print (script.Parent.InputBox.Text) script.Parent.InputBox.Text = "" end) end
How whould you prevent this script from running 200 times?
Hello, MageMasterHD!
To make that, do the following:
1 - Remove the While Loop
2 - Add debounce
Edited Script
wait () local deb = false --Debounce variable script.Parent.InputBox.InputEnded:Connect(function () --This is a event, no loops needed =D if (not deb) then --Test for debounce(prevent running several time) deb = true --sets debounce to true print (script.Parent.InputBox.Text) script.Parent.InputBox.Text = "" wait(5) --Debounce Time deb = false --sets debounce to false end end)
Good Luck with your games
I do believe there is a way to disconnect functions. I do not know much about this but I do think it works. Correct me if I am wrong.
wait () while true do wait () clicked = script.Parent.InputBox.InputEnded:Connect(function ( print (script.Parent.InputBox.Text) script.Parent.InputBox.Text = "" clicked:disconnect() end) end
Try it and it might work but I am not 0 sure I posted this answer so that if it did work then it would help you.
Hope it works!