objects = {} wait(1)
script.Parent:WaitForChild("Buttons") for i,v in pairs(script.Parent.Buttons:GetChildren()) do if v:FindFirstChild("Head") then
local oject = script.Parent.Purchases:FindFirstChild(v.Object.Value)
if objects ~= nil then
objects[object.Name] = object:Clone{}
object:Destory()
else
print("Button: "..v.Name.." is missing its object and has been removed.")
v.CanCollide = false
v.Transparency = 1
end
v.Head.Touched:connect(function(hit)
local player = game.PlayersGetPlayerFromCharacter(hit.Parent)
if v.Head.CanCollide == true
if player ~= nil then
if script.Parent.Owner.Value == player then
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Humanoid.Health > 0 then
local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)
if cashmoney ~= nil then
if cashmoney.Value >= v.Price.Value then
cashmoney.Value = cashmoney.Value - v.Price.Value
objects[v.Object.Value].Parent= script.PurchasedObjects
v.Head.CanCollide = false
v.Head.Transparency = 1
end
end
end
end
end
end
end
end)
end
end

3 comments
it says " if player ~= nil then" is incorrect. the "if" is on line 14
Can you get the whole thing inside the code block?
'local oject = script.Parent.Purchases:FindFirstChild(v.Object.Value)' 'oject' Typo?