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

Why wont this work?

I am currently making a game that is a spot the difference prison escape game and I am using click teleports I have scripted.

The click teleport has a clickdetector with a range of 32 for the correct answer and the script is

function onClicked()

local c = game.Players:GetChildren() 
for i = 1, #c do 
c[i].Character.Torso.CFrame = CFrame.new(script.Parent.Parent.OnePartTele.Position)
end 

end 

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Because the brick for where it should teleport is name "OnePartTele" and it works. For the next stage I did the same thing a click detector with range of 32 and the same script but changed "OnePartTele" to "PartTwo" and the script is

function onClicked()

local c = game.Players:GetChildren() 
for i = 1, #c do 
c[i].Character.Torso.CFrame = CFrame.new(script.Parent.Parent.Part2.Position)
end 

end 

script.Parent.ClickDetector.MouseClick:connect(onClicked)


for the second teleport the script is not working,

Anyone know how I can fix this?

6 comments

1

Any errors?

0

You lied.

1

Also, you have no connection line at the end of the second script, did you copy it all or is that the problem?

0

I realized the difference so I fixed it and still noticed that it didnt work. @Satire and @Undeniable

1

So are there any errors and do either of them work?

0

@Undeniable there was an error in the 2nd script when I ran it with output window.

1 answer

I opened output and saw that the teleporter was looking for a brick in a model so I ungrouped the model it was looking for.

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