I have a script and Its supposed to give a tool to a player if they have a certain amount of Cash, (in this case Cash is Bills) and if they click the button
So if the player clicks the button, and they have enough bills, then the sword (Sword1) is cloned and put into the players backpack.
How ever the script i have here does not work, does anybody know why it wont?
script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
if player:WaitForChild("leaderstats").Bills.Value == script.required.Value then
game.ServerStorage.Sword1:Clone().Parent = player:WaitForChild("Backpack")
end
end)
Things to remember:
The script is a local script
It has a number value called "required" which value is 100 and is parented to the local script
The sword is located in the ServerStorage

2 comments
Yo dude tysm is worked <3
@PurpleProgram No problem, glad I could help! :)