local Player = script.Parent.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.MouseButton1Click:connect(function()
local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(Player.Name)
-- STOPS HERE
if cashmoney ~= nil then
if cashmoney.Value >= script.Parent.Cost.Value then
cashmoney.Value = cashmoney.Value - script.Parent.Cost.Value
game.Lighting.Shop.Swords[script.Parent.ItemName.Value]:Clone().Parent = Player.Backpack
game.Lighting.Shop.Swords[script.Parent.ItemName.Value]:Clone().Parent = Player.StarterGear
end
end
end)
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.

1 comment
Your script might not work in online modes (even fixing your current problem) -- this script looks like a LocalScript (based on the player being an ancestor of the script), but clients don't get access to ServerStorage. If your script is a normal/server Script, then no problem.