I did this but the script just crashed! help please
spawn = spawnlocation.Postition for i,v in pairs(game.Players:GetPlayers()) do name = v.name char = game.Workspace:FindFirstChild(name) if char ~= nil then char2 = char:FindFirstChild("Humanoid") if char2 ~= nil then char:MoveTo(spawn) game.Lighting.RocketLauncher:Clone().Parent = v.BackPack game.Lighting.Timebomb:Clone().Parent = v.BackPack end end end
access = {"shawnyg", "bob"} spawn = game.Workspace.SpawnLocation game.Players.PlayerAdded:connect(function(plr) for i,v in pairs(access) do if plr.Name == v then tool = game.Lighting["ToolNameHere"] tool:clone().Parent = plr.Backpack --tool:clone().Parent = plr.StarterGear --Above is if you want it to stay with them plr.Character:MoveTo(spawn) --If I'm wrong with this line, add spawn.Position end end end)
~ Did I help you? Well, help me out by bumping up my reputation/accepting my answer!
Try this instead.
spawn = Vector3.new(0,0,0)--Change the 0,0,0 to the position you want the player teleported. for i,v in pairs(game.Players:GetPlayers()) do name = v.name char = v.Character--Character is sort of a hidden value within Player, that takes you to the workspace version of that player. Handy to know. if char ~= nil then char2 = char:FindFirstChild("Humanoid") if char2 ~= nil then char.Torso.CFrame = CFrame.new(spawn) -- Changes the CFrame of the torso, in turn teleporting the player. game.Lighting.RocketLauncher:Clone().Parent = v.BackPack game.Lighting.Timebomb:Clone().Parent = v.BackPack end end end
If this doesn't work, tell me the error and I'll try to fix it.