i'm trying to make a button that teleports you on click if you have a certain amount of a stat in leaderstats. but when i tested it in the output it said "09:48:46.017 - Money is not a valid member of Player"
but when i select children it is part of the player.
can anyone help? here's the script if needed
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
if plr.Money.Value > 0 then -- here's the error "Money" plr.Character.HumanoidRootPart.CFrame = CFrame.new(281, 30.6, -26) end
end) thanks
If the Money's parent is leaderstats, then an easy fix is to just do:
if plr.leaderstats.Money.Value > 0 then plr.Character.HumanoidRootPart.CFrame = CFrame.new(281, 30.6, -26) end
Based on your comment, this is for a leaderboard. The "Money" value should be located in the leaderstats folder. So you'd have to do:
plr.leaderstats.Money.Value