I made a script thats supposed to change the action text of a proximity prompt if the players character has a tool inside of it.
But its not working.
local prompt = script.Parent
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
for _, v in pairs(char:GetChildren()) do
if v:IsA("Tool") then
prompt.ActionText = "Place " .. v.Name
print("prompt actiontext changed")
end
end
end)
end)
If you’re using a proximityPrompt you can simply use the Trigger Event. It’ll get the player which you can then get the character from. After that you can check if the player has a tool currently “equipped”. That should work.
Your code will only work every time the character is loaded and the tool is in their character…