I was trying to make a button that if you have enough point and you click the button, it will teleport you to the part. But it keeps giving me error like "Player is not a valid member of DataModel" What can I do to fix this? Someone Help!
script.Parent.MouseButton1Click:connect(function() if game.Player.leaderstats.LifeFormFound.Value >= 4 then game.Players.LocalPlayer.character.LowerTorso.CFrame = CFrame.new(workspace.Point.Position) print('Successful') else print('Fail') end end)
Someone Please Help!
Make a it a local script , LocalPlayer can't be used by a normal Script. Also You have to use cap at C of connect , Because connect is deprecated , And can be deleted soon by roblox. Here the source for local script.
script.Parent.MouseButton1Click:Connect(function() if game.Players.LocalPlayer.leaderstats.LifeFormFound.Value >= 4 then game.Players.LocalPlayer.Character.LowerTorso.CFrame = CFrame.new(workspace.Point.Position) print('Successful') else print('Fail') end end)