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

Need help on this script?

i need help on the elseif,else or "words similar to elseif" thing and pls dont change anything in the "function Teleport_it()" until "CheckPlayers()" plss correct this script without changing the things that i told you

function Teleport_It()
if it ~= nil then
		if it.Character ~= nil then
                if it.Character.Humanoid.Health >= 0  then			
		it.Character.Humanoid.WalkSpeed = 30
		it.Character.Humanoid.MaxHealth = 200
		it.Character.Humanoid.Health = 200	
                local s = game.ServerStorage.ItScript:clone()
                s.Parent = it.Character
                s.owner.Value = it.Name
                game.ServerStorage:findFirstChild("Trap[3]"):clone().Parent = it.Backpack
                game.ServerStorage:findFirstChild("Fake It[2]"):clone().Parent = it.Backpack
		game.ServerStorage:findFirstChild("Flashlight"):clone().Parent = it.Backpack
		local location = pickedMap.Spawns.ItSpawn
		it.Character.Torso.CFrame = CFrame.new(Vector3.new(location.Position.x,location.Position.y + 3,location.Position.z))
                wait(0.2)
                end
        end
ItCountDown()
else	 		
h.Text = it.Name.. " left the game!"
wait(2)
h.Text = "Re-Starting game!"
wait(2)
h:remove()
local list = game.Players:children()
for i = 1, #list do
       if list[i].Character ~= nil then
       list[i].Character:BreakJoints()
       list[i].Alive.Value = false
       end
end
CheckPlayers()
end 
end
else  > -- this is the part that makes errors it always has a red thing underlined in this lua word
if it.Character.Humanoid.Health >= 0  then	
findalive()
end 

1 answer

I think this is correct...

function Teleport_It()
	if it ~= nil then
		if it.Character ~= nil then
			if it.Character.Humanoid.Health >= 0  then		  
				it.Character.Humanoid.WalkSpeed = 30
				it.Character.Humanoid.MaxHealth = 200
				it.Character.Humanoid.Health = 200  
				local s = game.ServerStorage.ItScript:clone()
				s.Parent = it.Character
				s.owner.Value = it.Name
				game.ServerStorage:findFirstChild("Trap[3]"):clone().Parent = it.Backpack
				game.ServerStorage:findFirstChild("Fake It[2]"):clone().Parent = it.Backpack
				game.ServerStorage:findFirstChild("Flashlight"):clone().Parent = it.Backpack
				local location = pickedMap.Spawns.ItSpawn
				it.Character.Torso.CFrame = CFrame.new(Vector3.new(location.Position.x,location.Position.y + 3,location.Position.z))
				wait(0.2)
			end
		end
		ItCountDown()
	elseif it.Character.Humanoid.Health >= 0  then  
		findalive()
	else			
		h.Text = it.Name.. " left the game!"
		wait(2)
		h.Text = "Re-Starting game!"
		wait(2)
		h:remove()
		local list = game.Players:children()
		for i = 1, #list do
			if list[i].Character ~= nil then
				list[i].Character:BreakJoints()
				list[i].Alive.Value = false
			end
		end
		CheckPlayers()
	end 
end

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