Why does my tool.Activated only be activated when I hold not click?
I'm trying to make a time slower script but for some reason, I need to hold when using the tool even though I used tool.Activated and Deactivated. Here are the scripts.
local tool = script.Parent tool.Activated:Connect(function() game.ReplicatedStorage.TimeSlow:FireServer(true) end) tool.Deactivated:Connect(function() game.ReplicatedStorage.TimeSlow:FireServer(false) end)
game.ReplicatedStorage.TimeSlow.OnServerEvent:Connect(function(plr, bool) if bool == true then for i,v in pairs(game.Players:GetPlayers()) do script.Slowed:Clone().Parent = v.PlayerGui v.Character.Humanoid.WalkSpeed = 1 workspace.Gravity = 50 end elseif bool == false then for i,v in pairs(game.Players:GetPlayers()) do v.PlayerGui.Slowed:Destroy() v.Character.Humanoid.WalkSpeed = 16 workspace.Gravity = 196.2 end end end)
There are no errors but I still need to hold instead of click.
try this:
tool.Activated:Connect(function() if bool == true then game.ReplicatedStorage.:WaitForChild("TimeSlow"):FireServer(true) if bool == false then game.ReplicatedStorage.:WaitForChild("TimeSlow"):FireServer(false) end end end)
tell me if you have a problem with this ok?