So, I'm trying to make a gun shop gui on my game and it doesn't work and the output doesn't say anything and idk what to do... (It's in a local script)
function BuyGun()
local Clicked = game.Players.LocalPlayer
local Player = game.Players:WaitForChild(Clicked)
if Player.leaderstats.Points.Value >= 10 then
Player.leaderstats.Points.Value = Player.leaderstats.Points.Value - 10
local Gun = game.ServerStorage.Pistol:Clone()
Gun.Parent = Player.Backpack
end
end
script.Parent.MouseButton1Click:connect(BuyGun)

4 comments
Hmm, thanks, I used FindFirstChild because the wiki said LocalPlayer was read only, but I guess the wiki was wrong then. XD
Well technically, thats not incorrect. Read-Only just means that you can get data from it, you just can't overwrite what is already there. So basically, you can get and use LocalPlayer, you just can't change LocalPlayer to something other than what it already is.
But uh, glad I could help :P
Ok... Now I know what wiki means when it says read only..... :p