Hello. I am making a tycoon and I was making a button when I decided to test it. And to check the working of it, I decided to make some prints:
model = script.Parent.Parent.Parent.Factory.D1
cost = 0
local backup = model:Clone()
backup.Parent = game.ServerStorage.Objects
model:Destroy()
-- we only need what's below this line
script.Parent.Head.Touched:connect(function(h)
if h.Parent.Name == game.Players:FindFirstChild(h.Parent.Name) then
if h.Parent.Name == script.Parent.Parent.Parent.OwnerShipSystem.Owner.Value then
local playername = h.Parent.Name
if game.Players[playername].leaderstats.Money.Value >= cost then
game.Players[playername].leaderstats.Money.Value = game.Players[playername].leaderstats.Money.Value - cost
backup.Parent = script.Parent.Parent.Parent.Factory
print("Transaction completed! :)")
script.Parent:Destroy()
else print ("The owner hasn't money...")
end
else print ("This player isn't the owner")
end
else print("This isn't a player")
end
end)
But when I step with an player on it, it says always "This isn't a player" Why??? Need more info?

1 comment
thanks! i didnt know it was so simple,,,