Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[Solved] Script won't teleport the Character?

plr = game.Players.LocalPlayer
char = plr.Character
char:WaitForChild("Humanoid").Died:Connect(function()
	print("Death")
	local char = (plr.Character) or (plr.CharacterAdded:Wait()) -- // set the new character model
	if (char and char.Parent) then
		print(char.Name .. " exists!")
		local stage = plr.leaderstats.Stage.Value
		print ("Stage value found")
		if stage == 0 then
			print("Stage is 0")
			char:SetPrimaryPartCFrame(workspace.StageSpawns.Stage0.CFrame)
			print("TELEPORTED")
		end
	end
end)

See my code prints all the statements and says TELEPORTED in output but doesn't teleport me to Stage0 CFrame.

The script is a local script in player gui.

I made a script in ServerScriptService so the script doesn't reset

game:GetService("StarterGui").ResetPlayerGuiOnSpawn = false

1 comment

0

Nevermind it works

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.