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

Need help on this script?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

Log in to vote
0
Answered by
samfun123 235 Moderation Voter
10 years ago

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
Ad

Answer this question