It's pretty simple, except, i dont know how to do it.
I just need a script that gives the player a tool on spawn if they have 50 Gold.
Thank you for Helping!
Hopefully, this answers your question if it did please accept my answer.
This script will check each time a player's gold is updated and if the value is over or equal to 50 gold it will give it the tool.
The tool part you have to do yourself because I do not know what the tool's name is.
I've tested the script and it should work perfectly only you have to remember to change the tool's name in line 13
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") Players.PlayerAdded:Connect(function(player) while true do wait(.5) local PlayerGold = player.leaderstats.Gold if PlayerGold.Value >= 50 then -- When a player gets 50 or more gold he gets the tool local ToolCopy = ReplicatedStorage.Tool:Clone() -- Change where it says ("Tool") to your tool's name ToolCopy.Parent = player.Backpack script:Destroy() break end end end)
Where would this script go?
So I decided to re-write johnoscarbhv1's script into something that won't continuously duplicate the tool. I didn't test it but I hope it works for you:
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") Players.PlayerAdded:Connect(function(player) local PlayerGold = player.leaderstats.Gold repeat wait(0.5) until PlayerGold.Value == 50 or PlayerGold.Value > 50 local ToolCopy = ReplicatedStorage.Tool:Clone() -- Change where it says ("Tool") to your tool's name ToolCopy.Parent = player.Backpack end)