Not quite sure what you're asking, but I've come up with a script.
02 | local Tool = script.Parent |
03 | local Player = game.Players.LocalPlayer |
05 | local RE = game:GetService( "ReplicatedStorage" ):WaitForChild( "RemoteEvent" , 10 ) |
06 | Tool.Activated:Connect( function () |
17 | game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect( function (player) |
18 | local PlrTab = Players [ player ] |
19 | if (PlrTab ~ = nil ) then |
20 | local deClick = PlrTab.Clicked |
21 | if (deClick = = false ) then |
23 | print ( "Clicked!!!, Starting process" ) |
24 | player.Time.Value = true |
26 | player.Time.Value = false |
27 | print ( "Stopping Ignoring Clicks for now!" ) |
28 | PlrTab.Clicked = false |
30 | print ( "All ready Clicked ignoring..." ) |
35 | game.Players.PlayerAdded:Connect( function (plr) |
37 | local Time = Instance.new( "BoolValue" ,plr) |
47 | game.Players.PlayerRemoving:Connect( function (plr) |
49 | if (table.find(Players,plr) ~ = nil ) then |
This script logs every player that joins the game and adds your Time bool value to each player. The server side script then waits for a player to activate or click with the tool to change the Time.Value
from false to true, as you had, then waits 5 seconds before changing it back to false.
I've made it ignore any other clicks made by a player. Thus stopping the click spam.
I've also allow other players to change their Time bool values without locking up the system until the Clicked Value gets changed back to false.
Let me know if you need anything :)