Moving player to part

i willl track ur location peasant

this is what i am trying to say

put a print above the player var and see if it prints anything because that while loop should be printing

Try:

local placeToMove = workspace:FindFirstChild(checkpointWord..nextPoint, true)

like this?

print("Test12")
local Player = game:GetService("Players").LocalPlayer
local rightbutton = Player.PlayerGui.LevelGui.Main.Right
local levelchange = game.Workspace.StageChange
local lastStage = Player.leaderstats.Stage
local checkpointWord = "Checkpoint"
local tur = true

while tur do
	wait(0.1)
	print("testing")
end

rightbutton.MouseButton1Click:Connect(function() 
	print("testing")
	if (levelchange.Value == lastStage.Value) then
		print("error")
		return "error, last stage currently unlocked"
		
	else
		print("hello?")
		local nextPoint = levelchange + 1
		local placeToMove = checkpointWord .. nextPoint
		local partToMove = workspace:FindFirstChild(placeToMove)
		Player.Character.HumanoidRootPart.CFrame = partToMove.Cframe
	end
end)

if so, still doesnt print

Please just remove the while loop part. Don’t keep it there

1 Like

is the script deactivated or soemthing

i do part of that in

local partToMove = workspace:FindFirstChild(placeToMove)

as far as i can tell, it is activated

Just send a picture of the properties of that script at this point :skull:

Okay, now I haven’t seen anybody say this but… why are you trying to do all of this in a LocalScript? That’s a terrible idea. You’re creating a barrier in anti-exploit, Server and Client communication, etc. None of these changes will reflect on the server.

Also, why is a button being used to change stages? Why not use a part and a .Touched event?

im making a platformer, so i use a gui to switch between stages you have already completed

image_2024-04-29_120057339

Use some form of client to server communication, handling all of this on the client is terrible.

why is it in serverscriptservice

1 Like

where should it be?
ah wait… should it be in player scripts…

yea idk where it goes, player scripts isnt right so i really dont know

Just put it in StarterPlayerSciripts… (just finish my pain, pls)

i tried that : /
it still didnt even run
(im sorry)

What is your code at this moment