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 Script
local tool = script.Parent
tool.Activated:Connect(function()
game.ReplicatedStorage.TimeSlow:FireServer(true)
end)
tool.Deactivated:Connect(function()
game.ReplicatedStorage.TimeSlow:FireServer(false)
end)
Server Script
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.

1 comment
that won't work because bool is not a variable in this script, it just came out of nowhere, even if i did put bool it still won't work