player = game.Players.LocalPlayer money = player.leaderstats.Captures price = 0 tool = game.ServerStorage:findFirstChild("Burst") function buy() if money.Value >= price then money.Value = money.Value - price local a = tool:clone() a.Parent = player.Backpack local b = tool:clone() b.Parent = player.StarterGear end end script.Parent.MouseButton1Down:connect(buy)
This is a local script! I dont know whats wrong with it! Its a Local Script! I added the guns in Server Storage! But its still not working! The gun is named Burst
You need to write it so that it waits for 'player.leaderstats.Captures'
you can write something like...
player = game.Players.LocalPlayer if not player.leaderstats then wait() end money = player.leaderstats.Captures price = 0 tool = game.ServerStorage:findFirstChild("Burst")
then write the rest of your script... just add that if not player.leaderstats then wait() end because the player is taking a while to load so the script is gonna be like "wut r u doin" but yeah just make it wait for the player's children to load :)