Player = game.Players.LocalPlayer
script.Parent.Text=tostring(script.Parent.ItemName.Value)..": "..tonumber(script.Parent.Cost.Value).." "..tostring(script.Parent.Currency.Value)
script.Parent.MouseButton1Click:connect(function()
if Player:findFirstChild("leaderstats") then
if Player.leaderstats[script.Parent.Currency.Value].Value>=tonumber(script.Parent.Cost.Value) then
Player.leaderstats[script.Parent.Currency.Value].Value=Player.leaderstats[script.Parent.Currency.Value].Value-tonumber(script.Parent.Cost.Value)
game.Lighting[script.Parent.ItemName.Value]:Clone().Parent=Player.Backpack
game.Lighting[script.Parent.ItemName.Value]:Clone().Parent=Player.StarterGear
end
end
end)
That is a Local Script, and it is not working! What can i do? Please Help, I have 3 String Values in there called Currency, Cost, and Item Name, and the gun, which is Identical to the name of the item name, is is Lighting, but i think somthing is wrong with the script i made!

4 comments
Can we have your error message, if applicable? :)
1st Do not use Lighting to store object use server storage or rep storage, 2nd you should not be changeing the leaderstats or cloneing to the player backpack in a localscript
Should it be a Script????? Or what should i change in the script?
Its working in Studio test mode, but not in Player!