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

How, would I go about making this wait before doing this action again?

What I mean is, I've made this script where if I touch a certain brick or a certain area It shows a red line around the area and puts a red line across a certain area.

workspace.Extra.CFrame = CFrame.new(hit.Parent.Torso.Position.X, G2.Position.Y+0.02, G2.Position.Z)

How would I go about making this wait about 5 seconds before its able to run again?

1 comment

0

wait(5)

1 answer

http://wiki.roblox.com/index.php?title=Debounce

local db = false --short for debounce

if not db then --same as saying if db == false then
db = true --prevent the previous line from running
	workspace.Extra.CFrame = CFrame.new(hit.Parent.Torso.Position.X, G2.Position.Y+0.02, G2.Position.Z)
	wait(5)
db = false
end

It's fairly, simple, you'll get it ;]

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