Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved] Script won't teleport the Character?

Asked by 2 years ago
Edited by chess123mate 2 years ago
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
0
Nevermind it works Ind1v1duals 43 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

Answered

Ad

Answer this question