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

How can I stop my spell script from working after a few seconds?

Asked by 4 years ago

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.

01local ReplicatedStorage = game:GetService("ReplicatedStorage")
02local test = true
03local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEventTest")
04 
05local player = game.Players.LocalPlayer
06    local mouse = player:GetMouse()
07 
08player.Chatted:connect(function(msg)
09    if msg:lower() == "feusur" and  player.TeamColor == BrickColor.new("Mulberry") then
10        local number = 1
11        mouse.Button1Down:Connect(function()
12            if number == 1 then
13            if test == true then
14            local period = mouse.Hit
15            local boo = Vector3.new(0, 0, 90)
View all 25 lines...

1 answer

Log in to vote
0
Answered by 4 years ago

Have you tried changing the line 20's test to false?

0
That just disables it after one use. youngsavagehard 20 — 4y
0
OOF snipperdiaper 120 — 4y
Ad

Answer this question