How can I stop my spell script from working after a few seconds?
So I'm making a game that involves spells, but I can't figure out how to make it so that after 3 seconds, the click detector won't work unless you say the spell again. How can I do this? Is it possible? I tried a wait(), but it just pauses the whole script.
01 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
03 | local remoteEvent = ReplicatedStorage:WaitForChild( "RemoteEventTest" ) |
05 | local player = game.Players.LocalPlayer |
06 | local mouse = player:GetMouse() |
08 | player.Chatted:connect( function (msg) |
09 | if msg:lower() = = "feusur" and player.TeamColor = = BrickColor.new( "Mulberry" ) then |
11 | mouse.Button 1 Down:Connect( function () |
14 | local period = mouse.Hit |
15 | local boo = Vector 3. new( 0 , 0 , 90 ) |
16 | remoteEvent:FireServer(period, boo) |