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

Why Does This Touching Script Not Work?

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.

1 comment

0

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

1 answer

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.

3 comments

0

I have a red line at the last end :l

0

Delete the ) and put it on the other one.

0

Did that, this time it shows a red line at the first end I put the ) on.

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