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

Why wont this work?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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?

1
Any errors? General_Scripter 425 — 8y
0
You lied. User#6546 35 — 8y
1
Also, you have no connection line at the end of the second script, did you copy it all or is that the problem? General_Scripter 425 — 8y
0
I realized the difference so I fixed it and still noticed that it didnt work. @Satire and @Undeniable AverageHackerman 0 — 8y
View all comments (2 more)
1
So are there any errors and do either of them work? General_Scripter 425 — 8y
0
@Undeniable there was an error in the 2nd script when I ran it with output window. AverageHackerman 0 — 8y

1 answer

Log in to vote
-3
Answered by 8 years ago

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.

Ad

Answer this question