(Surface GUI) What is going wrong, if the script has no errors?
01 | local Player = script.Parent.Parent.Parent.Parent.Parent.Parent |
03 | script.Parent.Text = tostring (script.Parent.ItemName.Value).. ": " .. tonumber (script.Parent.Cost.Value).. " " .. tostring (script.Parent.Currency.Value) |
04 | script.Parent.MouseButton 1 Click:connect( function () |
05 | local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(Player.Name) |
07 | if cashmoney ~ = nil then |
08 | if cashmoney.Value > = script.Parent.Cost.Value then |
09 | cashmoney.Value = cashmoney.Value - script.Parent.Cost.Value |
10 | game.Lighting.Shop.Swords [ script.Parent.ItemName.Value ] :Clone().Parent = Player.Backpack |
11 | game.Lighting.Shop.Swords [ script.Parent.ItemName.Value ] :Clone().Parent = Player.StarterGear |
The script is a "purchase" script inside of a Surface GUI on a brick. I have tried printing a number every single line, the script appears to stop just before if cashmoney ~= nil then, although cashmoney is present.