I'm trying to get this Surface Shop I have working but it seems to not work... So I wonder if anyone can help figure out what's wrong with the Script?
The layout of this shop goes from
Shop (Brick)
- Shop (SurfaceGUI)
-- Main (Frame)
-- Window (Frame)
--- Left (TextBox)
--- Right (TextBox)
--- Sword1 (TextBox) \/ Same for other Sword's till Sword 10
---- Cost (NumberValue)
---- Currency (StingValue)
---- ItemName (StingValue)
---- Shop (Main Script)
This is the Script in Shop (Main Script) what's wrong with it?
Player=script.Parent.Parent.Parent.Parent.Parent
script.Parent.Text=tostring(script.Parent.ItemName.Value)..": "..tonumber(script.Parent.Cost.Value).." "..tostring(script.Parent.Currency.Value)
script.Parent.MouseButtom1Click: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)

2 comments
Anyone?
Anyone?