Im trying to create a cleaning job, and im so curious on how to do this certain thing. I have a part, that on clicked (Using a click detector) puts the humanoid walkspeed to 0, and then a few seconds later, the part goes transparent and the walkspeed is normal, then 5 or so seconds later, the part reappears allowing you to reclick and redo the process. My question is how do I make is so when you click on the part with a tool, it runs the same thing, iv tried everything from events, to surface guis, but can't seem to do it. Either im doing those wrong or theres some other solution.
Heres the script.
cleaned = false
script.Parent.ClickDetector.MouseClick:Connect(function(Player) if cleaned == false then local plr = game.Workspace:FindFirstChild(Player.name) cleaned = true plr.Humanoid.WalkSpeed = 0 game.ServerStorage.RemoteEvent:FireClient(Player) wait(10)--Change to whatever you want it too plr.Humanoid.WalkSpeed = 16 script.Parent.Transparency = 1 script.Parent.CanCollide = false wait(5)--Change to whatever you want it too script.Parent.Transparency = 0 script.Parent.CanCollide = true cleaned = false end end)
any help?