Hi Developers, Today I have a Question, how and where can I set the ProximityPrompt to activate when a specific tool is equipped?
(The ProximityPrompt is script.Parent)
local db = true local Robo1 = script.Parent.Parent.Parent.Robo1:GetChildren("RB1") script.Parent.Triggered:Connect(function(plr) if db == true then db = false plr.leaderstats.Money.Value = plr.leaderstats.Money.Value + 250 Robo1.Transparency = 1 script.Parent.Parent.Parent.Sonido.S.Playing = true wait(5) Robo1.Transparency = 0 db = true else if plr.PlayerGui:FindFirstChild("NoMoneyPrompt") then plr.PlayerGui:FindFirstChild("NoMoneyPrompt"):Destroy() local errorprompt = game.ReplicatedStorage.RobberyGUI.NoMoneyPrompt:Clone() errorprompt.Parent = plr.PlayerGui wait(1) errorprompt:Destroy() else local errorprompt = game.ReplicatedStorage.RobberyGUI.NoMoneyPrompt:Clone() errorprompt.Parent = plr.PlayerGui wait(1) errorprompt:Destroy() end end end)
Thanks!
Using :FindFirstChild()
You can try using :FindFirstChild()
to see if player equip the tool
If a Player use the tool, the tool will move from Player Backpack
to the Player Character
. So you can use :FindFirstChild()
to the Player Character
to check if player equip the tool.
Script:
local Tool = "ToolName" script.Parent.Triggered:Connect(function(plr) if plr.Character:FindFirstChild(Tool) then print("Player Equip The Tool") end end)
Haven't Tested It Yet!
Feel Free to Comment!
Thank's for Reading!