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

Why Does This Touching Script Not Work?

Asked by 10 years ago

This script is with my game script in the StarterGui folder in the explorer inside a frame. 'Tick' is a soundtrack. Heres the script:

function Workspace.Map1.Touching.onTouched(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!"
wait(5)     
    end 
end

Apparently I have a red line on line 2. Why's that? If anybody knows, can you please help me.

0
You are not connecting the function right... please, follow the example: http://wiki.roblox.com/index.php?title=Touched Tesouro 407 — 10y

1 answer

Log in to vote
0
Answered by 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)
Workspace.Tick:Play()
Workspace.GUIPart.SurfaceGui.Frame.TextLabel.Text = "<[NamesNotImplementedYet]> Has Won The Round!"
wait(5)     
    end 
end)

Just needed to change the end and the function.

0
I have a red line at the last end :l DesignerDavid 0 — 10y
0
Delete the ) and put it on the other one. Grenaderade 525 — 10y
0
Did that, this time it shows a red line at the first end I put the ) on. DesignerDavid 0 — 10y
Ad

Answer this question