hello, I am trying to make a game where if you have a tool equipped and you activate a proximity prompt then it will give you one outcome but if you don't have the tool equipped then it will give you a different outcome.
Here is the code inside the tool:
script.parent.Equipped:Connect(function()
_G.equipped = true
end)
script.parent.Unequipped:Connect(function()
_G.equipped = false
end)
Here is the code inside of the part with the proximity prompt:
script.Parent.ProximityPrompt.TriggerEnded:Connect(function(player)
if _G.equipped == true then
print("outcome 1")
else
print("outcome 2")
end
end)
If anybody could help, that would be great! Thanks!

7 comments
Oh and i mispelled Triggered
yea, I'm trying to make it for a specific tool so that prob wont help
I helped something with a similiar thing so ill edit my comment to that code
I've edited it now.
if I understood correctly, theres no script inside of the tool and thats the script inside the proximity prompt part, right? bc it doesn't work. thx for trying to help anyway!
Yeah
Just put your tool name in the table, it works for me.