Why is my script not working

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
local cash = player.leaderstats.Cash
if cash.Value >= 2500 then
cash.Value -= 2500
game.ServerStorage.Tools:WaitForChild(“GoldenSword”):Clone().Parent = player.Backpack
else
print(“false”)
end
end)

Are you requesting this through the server or through the client? And do you get any error messages in the console?

1 Like

You have to be more clear on why it isn’t working. But meanwhile I will try and help you out
If this is a server script then it should work (need more info so please post that)
If this is a local script then:

  1. Local scripts do not work in the workspace, so put the local script in StarterPlayerScripts instead and change the path to the location of the ‘script.Parent’
  2. You cannot access items in server storage with a local script. So change script to a server script