|
| 27 Jun 2013 12:24 PM |
So what happens here is
you touch a brick
this is a touched function
when you touch the brick
I am going to anchor the torso
unfortunately
I have never learned how to find the player
It's probably about time I did it now
Here is my poor attempt
local TouchedIt = false function Teleportation() if TouchedIt == false then Plyr = game.Players:findFirstChild(player) Plyr.Torso.Anchored = true TouchedIt = true
--some other crap is here but i removed it because I know it works
script.Parent.Touched:connect(Teleportation)
|
|
|
| Report Abuse |
|
|
BlueMond
|
  |
| Joined: 26 Dec 2007 |
| Total Posts: 47 |
|
|
| 27 Jun 2013 12:26 PM |
| function Teleportation(whatevertouchedthebrick) |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2013 12:26 PM |
function Hit(part) if part.Parent:findFirstChild("Torso") ~= nil then part.Parent.Torso.Anchored = true end end
script.Parent.Touched:connect(Hit) |
|
|
| Report Abuse |
|
|
BlueMond
|
  |
| Joined: 26 Dec 2007 |
| Total Posts: 47 |
|
|
| 27 Jun 2013 12:29 PM |
| yeah he did a better job of describing it but in short you forgot to pass the parameter for the part that touched the thing that is being touched. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2013 12:31 PM |
I realize that now
now I understand why output was saying it was missing an argument or whatever
let me try your code - I'll tell you the results |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2013 12:37 PM |
This will contain errors, so u r gonna have to Open View>Output and read it.
local TouchedIt = false
function Teleportation(part) -- what 'part' hit this brick if TouchedIt == false then -- r we not busy? Touchedit = true -- close the gate so we r left alone.
local hum = part.Parent::findFirstChild(Humanoid) -- is there a Humanoid Object in the Parent of this part?
if hum then -- if so.... Plyr = part.Parent -- save a reference to that Parent Plry.Torso.Anchored = true -- Anchor the Torso in the Parent of this part.. end -- humanoid? . . TouchedIt = false -- Open gate
end -- busy, already?
end -- function
script.Parent.Touched:connect(Teleportation)
This may work, but more than likely no. U don't pay enough 4 me to test it. That's your job.
GL, Bri
|
|
|
| Report Abuse |
|
|
BlueMond
|
  |
| Joined: 26 Dec 2007 |
| Total Posts: 47 |
|
|
| 27 Jun 2013 12:39 PM |
| That contains debounce, you should learn about that too so the script doesn't run like 50 times when the player steps on it. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2013 12:42 PM |
I put debounce in the original
that was the touchedit value
anyway the script works fine - except when I anchor the torso you can still move in glitches
so I will set the walkspeed to 0 also
thanks everyone for the help |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2013 12:44 PM |
I realize that now
now I understand why output was saying it was missing an argument or whatever
aLLWAYS POST AN ERROR MESSAGE IF U HAVE ONE With the original, otherwise people assume u don't have Output open, and will ususaly not help u, 'cause there is no point. |
|
|
| Report Abuse |
|
|