Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can somome PLEASE Check my Shop Gui Script? I did somthing wrong and i can figure it out!

Asked by 8 years ago
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!

0
Can we have your error message, if applicable? :) WelpNathan 307 — 8y
0
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 User#5423 17 — 8y
0
Should it be a Script????? Or what should i change in the script? PartyScripters 20 — 8y
0
Its working in Studio test mode, but not in Player! PartyScripters 20 — 8y

Answer this question