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

Speed Run Spawn System not working Properly? Anyone check script?

This local script does not work on Studio, or Player!

local plr = game.Players.LocalPlayer
local char = game.Workspace:WaitForChild(plr.Name)
local lvl = plr:WaitForChild("leaderstats"):WaitForChild("Level")

repeat wait() until plr ~= nil and plr.Character ~= nil

local function spawn()
	char:MoveTo(game.Workspace:FindFirstChild("spawn"..lvl.Value).Position + Vector3.new(0, 6, 0))
	print("Spawned to level")
end

lvl.Changed:connect(function()
	spawn()
end)

plr.CharacterAdded:connect(function()
	wait()
	spawn()
end)

Should this be a local script? Just to be clear, all the blocks are named spawn 1, spawn 2, ect. And this is is Starter Gui, should it not be? Once you die, it takes you back to the original spawn, other than the blocks.... PLEASE help!

4 comments

0

It should be in a localsccript

0

Make sure there are no spaces between 'spawn' and the number in the parts' names.

0

What's the error? What debugging have you done? What's it supposed to do? What's it do instead?

0

Also you can get the character like this: [local char = plr.Character]

1 answer

I think I did something like this before, I am not 100% sure, but I don't think you can teleport the player in a localscript, try using a RemoteEvent?

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