I have some scripts that transport people to a specific spawn, one is for owners, one is for the owners friends. I have tried to fix them myself, but, I just made it worse...well, here they are.
Owner:
Name = "titan111" --player(s) to spawn at this spawn Spawn = "OwnerSpawn321" --The spawns name spwn = game.Workspace:FindFirstChild(Spawn) --find the spawn game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) wait(1) if char.Name:lower() == Name:lower() then char.Torso.CFrame = CFrame.new(spwn.Position+Vector3.new(0,5,0)) end end) end)
Friends:
local spawn = Script.Parent game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) if player:IsFriendsWith(12345678) then--12345678 is the User ID char:MoveTo(spawn.Position) end end) end)
It would really help me if you could fix these up, i'm not very good at scripting, anyone know easy lessons on how I can learn Lua? I've tried the ROBLOX wiki, they are to hard for me.
Why not just do this?
local owner = --owner name here local ownerSpawn = game.Workspace:FindFirstChild("OwnerSpawn321") local friendSpawn = game.Workspace:FindFirstChild("FriendSpawn") game.Players.ChildAdded:connect(function(player) if player.Name:lower() == owner:lower() then player.Character:MoveTo(Vector3.new(ownerSpawn.Position)) elseif player:IsFriendsWith(game.CreatorId) then player.Character:MoveTo(Vector3.new(friendSpawn.Position)) end end end)
It would be something like that. Note that I just thought that up, I can't test it.