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

How Do I End This!?!?

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.

This is in a normal script inside the StarterGui folder inside a frame:

game.Workspace.Map1.Touching.Touched:connect(function(Touching)
    if Touching.Parent ~= nil 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!"
Workspace.VictoryHappy1:Play()
wait(10)
end -- If I put a parentheses on this, I'll get a red line here.
end -- If I put a parentheses on this, I'll get a red line here.

If I just leave them both with no parentheses I'll get a red line at line 2. Is it me or am I going crazy!? Can someone please help me :'(

2 answers

Log in to vote
0
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago
game.Workspace.Map1.Touching.Touched:connect(function(Touching)
    if Touching.Parent ~= nil then
for i, v in pairs(game.Players:GetPlayers()) do
pcall(function() v.Character.Torso.CFrame = CFrame.new(Vector3.new(63, 0, 100)) end)
end --You forgot the end for this loop.
Workspace.Tick:Play()
Workspace.GUIPart.SurfaceGui.Frame.TextLabel.Text = "<[NamesNotImplementedYet]> Has Won The Round!"
Workspace.VictoryHappy1:Play()
wait(10)
end -- Since this isn't ending the function, no parenthesis.
end) --This line should have the parenthesis to end the function.
0
I get a red line at line 1 D: DesignerDavid 0 — 10y
Ad
Log in to vote
0
Answered by
Lacryma 548 Moderation Voter
10 years ago

You forgot to end the first if statement.

game.Workspace.Map1.Touching.Touched:connect(function(Touching)
    if Touching.Parent ~= nil 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!"
Workspace.VictoryHappy1:Play()
wait(10)
end 
end
end)

Answer this question