CFrame Teleportation not working? Touched Part Event.
I'm trying to create a simple teleportation. What I'm trying to do is make it like when you reach the end of the obby, you get points and then you teleport back to the brick. For some reason, it's not working and I don't know why. I'm attempting to teleport the HumanoidRootPart. (Also, the leaderstats value is not working but I'll post a separate question later.)
The descendants goes like this: game.Workspace.Folder.Part
01 | workspace.ObbyStuff.GetPoints.Touched:Connect( function (hit) |
02 | local brick = workspace.ObbyStuff.Teleporter |
03 | local debounce = false |
04 | if game.Players:GetPlayerFromCharacter(hit.Parent) then |
07 | local plr = game.Players [ hit.Parent.Name ] |
08 | hit.Parent.HumanoidRootPart.CFrame = brick.CFrame |
09 | plr.leaderstats.Points.Value = plr.leaderstats.Points.Value + 100 |
I have no idea why it is not working, and I would like help to solve this issue. No errors at least from what I see. Any help is appreciated, because I am [Visible Confusion].