I'm trying to make a teleport button that only lets you teleport if you have a certain amount of money on the leader board but there's an error on line 7 Player isnt a valid value, any help?
Here's my script:
function onClicked() local p = game.Players:GetChildren() for i = 1, #p do
if player.leaderstats.Money.Value > 1 then --player in this line wasnt valid, can someone explain why? im still new
end h.Parent.Torso.CFrame = CFrame.new(Vector3.new(281, 30.6, -26))
end end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 comment
Thanks for clarifying, sorry im new.