It's supposed to teleport the user to the lobby spawn and give them 35 points. Everything is set in order so there should not be a problem. Absolutely nothing happens when i step on it.
This is for the local player that steps on it.
Also i checked it's not any grammar errors with the leaderboard and points
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ERROR
14:31:10.026 - Workspace.Platform Run.Money!.Script:5: attempt to index global 'player' (a nil value)
Script
enabled = true
player = game.Players.LocalPlayer
script.Parent.Touched:connect(function(hit)
local leaderstats = player:FindFirstChild("leaderstats")
local points = leaderstats:FindFirstChild("points")
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid and enabled then
points.Value = points.Value + 35
hit.Parent:MoveTo(game.Workspace.LobbySpawn.Position)
wait(0.5)
enabled = false
wait(1)
enabled = true
end
end)

4 comments
put it in code blocks
https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site
Local Script or server script?
Local script