|
| 25 Nov 2012 09:12 PM |
I want when you touch the block you get teleported to the brick named Blah, can anyone help?
Blah = game.Workspace.Blah
function onTouched(hit) local Torso = hit.Parent:findFirstChild("Torso") if Torso ~= nil then Torso.CFrame = -->What goes here<-- end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:13 PM |
Blah = game.Workspace.Blah function onTouched(hit) local Torso = hit.Parent:findFirstChild("Torso") if Torso ~= nil then Torso.CFrame = Blah.CFrame end script.Parent.Touched:connect(onTouched)
¤¤ †KMXD† ¤¤
|
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:13 PM |
Blah = game.Workspace.Blah
script.Parent.Touched:connect(function(hit) local Torso = hit.Parent if Torso ~= nil then Torso:MoveTo(Blah.Position) end end)
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:15 PM |
Forgot the end
fail D:
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:15 PM |
@TheRobot
You can be teleporting any random model. . .
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:16 PM |
...
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Nov 2012 09:17 PM |
Blah = game.Workspace.Blah
script.Parent.Touched:connect(function(hit) local Torso = game.Players:GetPlayerFromCharacter(hit.Parent) if Torso == nil then return end Torso:MoveTo(Blah.Position) end end)
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:19 PM |
One too many ends.
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Nov 2012 09:20 PM |
"One too many ends."
2 :
The if statement and the event.
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:22 PM |
oh god
how did i not see that
Blah = game.Workspace.Blah
script.Parent.Touched:connect(function(hit) local Torso = game.Players:GetPlayerFromCharacter(hit.Parent) if Torso == nil then return end Torso:MoveTo(Blah.Position) end)
Sorry guys
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:22 PM |
script.Parent.Touched:connect(function(hit) local Torso = game.Players:GetPlayerFromCharacter(hit.Parent) if Torso == nil then return end --The if statement Torso:MoveTo(Blah.Position) end --Nothing end) --The event
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:47 PM |
@Knightmare
That is wrong, you would be trying to move his player instead of the character model |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:49 PM |
script.Parent.Touched:connect(function(hit) local TorsoP = game.Players:GetPlayerFromCharacter(hit.Parent) if TorsoP == nil then return end --The if statement TorsoBrick = TorsoP.Character.Torso TorsoBrick:MoveTo(Blah.Position) end) --The event |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 05:21 PM |
@Mister
That's wrong too.
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 09:17 PM |
@Mister
That wasn't my script, as I was only pointing out the extra end another person possessed. Also, as Robot stated, your script would also not work as you're trying to use the MoveTo() method on a part, which it is not a valid member of.
If it were me, I would go along the lines of:
local Blah = Workspace.Blah script.Parent.Touched:connect(function(Hit) if not Game.Players:GetPlayerFromCharacter(Hit.Parent) then return end Hit.Parent:MoveTo(Blah.Position) end)
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 10:07 PM |
local Blah = Workspace.Blah script.Parent.Touched:connect(function(Hit) if not Game.Players:GetPlayerFromCharacter(Hit.Parent) then return end Hit.Parent.Humanoid:MoveTo(Blah.Position) end)
I wiin. |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2012 04:01 PM |
Yes, let's make them walk there, if they could.
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|