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

What Is My Mistake In This 'if' Statement Script?!

Asked by 10 years ago

So I'm making an 'if' statement code with my game script, and so I want it to do is that when a person touches a part, all the players will spawn back to the lobby. Here was my attempt before I rage quitted:

wait(30)
Workspace.Tick:Play()
Workspace.GUIPart.SurfaceGui.Frame.TextLabel.Text = "No one has won? What a Pity..."
Workspace.Funny:Play()
for i, v in pairs(game.Players:GetPlayers()) do
pcall(function() v.Character.Torso.CFrame = CFrame.new(Vector3.new(63, 0, 100)) end) 
end
    wait(3)
end

elseif script.Parent.Parent.Parent.Character:OnTouched(Workspace.Map1.Touching)then
    for i, v in pairs(game.Players:GetPlayers()) do
pcall(function() v.Character.Torso.CFrame = CFrame.new(Vector3.new(63, 0, 100)) end) 
Workspace.Tick:Play()
Workspace.GUIPart.SurfaceGui.Frame.TextLabel.Text = "<[NamesNotImplementedYet]> Has Won The Round!"
wait(5)
    end

This script is inside the 'StarterGui' folder inside a frame. By the way, Tick is the sound. When I run this script, two things happen:

1.) It does not work. 2.) The output doesn't tell me where the error is.

Please help me :(

1 answer

Log in to vote
-1
Answered by 10 years ago

Is that the full script? because you cannot start if statements with elseif. If this isn't the full script, please provide it.

0
Theres the full script :) DesignerDavid 0 — 10y
Ad

Answer this question