Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Rvoy 0
7 years ago

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?

0
wait(5) arshad145 392 — 7y

1 answer

Log in to vote
0
Answered by
Fatul 9
7 years ago
Edited 7 years ago

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 ;]

Ad

Answer this question