--When I walk on this part, it keeps growing from my legs touching it. --How would I make a wait before it grows again? x = script.Parent x.Touched:connect(function() x.Size = x.Size + Vector3.new(1,1,1) x.CFrame = CFrame.new(-8,-1,-3) end)
x = script.Parent settime= 1 mov = false x.Touched:connect(function() if mov == false then mov=true x.Size = x.Size + Vector3.new(1,1,1) x.CFrame = CFrame.new(-8,-1,-3) wait(settime) mov=false end end)
As Alpha stated, you'd simply need to add in a debounce. To do this, you just need to add in a variable, which we can call "debounce" for simplicity. We'll set it up like this:
local x = script.Parent local debounce = false x.Touched:connect(function() if not debounce then --Checks if it's true debounce=true --Makes it so that it wont work until turned off. x.Size = x.Size + Vector3.new(1,1,1) x.CFrame = CFrame.new(-8,-1,-3) wait(1) --Waits before re-enabling it debounce=false --Sets it back to false so script can work end end)
Ok, so now your script should work fine. If you have any further problems/questions, please leave a comment below. Hope I helped :P