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

Tool runs click detector in range?

Asked by 5 years ago

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?

0
Check if the player has the tool in their character. If it is in their Character that means they have it equipped. MrGaming4me 28 — 5y
0
but with tools, you can use click detectors. Pooglies 7 — 5y
0
Tools are located in the Backpack, not the Character @YT_Gaming4me. DeceptiveCaster 3761 — 5y

Answer this question