|
| 22 Jul 2013 07:26 AM |
| I am trying to make a tool (or a hopperbin) that teleports players to certain coordinates, deletes their tools, then finally deletes itself. I can't quite wrap my mind around it though... Anyone want to help? |
|
|
| Report Abuse |
|
|
darthpyro
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 3569 |
|
|
| 22 Jul 2013 07:28 AM |
Step 1. Search up "teleport hopperbin" Step 2. Add in specific coordinates. Step 3. Define player's backpack.
Step 4. for i = 1, #backpack do backpack[i]:Destroy() end
Step5. script.Parent:Destroy()
The end. GG. |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 22 Jul 2013 07:30 AM |
Access the players name then find its character.
workspace:findFirstChild(script.ParentS).Torso.CFrame = CFrame.new(0,0,0) script.Parent:remove()
Are two lines you could use. |
|
|
| Report Abuse |
|
|
darthpyro
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 3569 |
|
|
| 22 Jul 2013 07:34 AM |
Smiley. Those lines are both unefficient.
"workspace:findFirstChild(script.ParentS).Torso.CFrame = CFrame.new(0,0,0)"
We have .Character. It's pretty nice.
script.Parent.Parent... .Character.Torso.CFrame = CFrame.new(0,0,0)
"script.Parent:remove()"
:remove() was deprecated. We don't use it anymore.
script.Parent:Destroy() |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2013 07:38 AM |
| I'm sorry, but I do not use free models. |
|
|
| Report Abuse |
|
|
darthpyro
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 3569 |
|
|
| 22 Jul 2013 07:45 AM |
| Then you're pathetic. Free models save you time, energy, and you learn from them. Get over your "omg free models are nooby" stage and come back. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2013 07:47 AM |
| As a hobby programmer, I enjoy being original. That is why I am not specifically asking for a script on this thread. I just needed some guidelines. |
|
|
| Report Abuse |
|
|
Zomebody
|
  |
| Joined: 01 Jun 2010 |
| Total Posts: 789 |
|
|
| 22 Jul 2013 07:56 AM |
@darthpyro
"Then you're pathetic. Free models save you time, energy, and you learn from them. Get over your "omg free models are nooby" stage and come back."
Sorry to interupt you, but you just said in another thread to someone that replied with something like "there are always free models, just sayin", that he had to get out..
@adammthomas2000 You can use what smiley just said. Not the most efficient, but easy to use. I assume you already know kind of stuff about selecting hopperbins and deselecting them and making connections with events to certain functions? If not, I can help you with that. Otherwise, you can teleport some player by moving it's Torso by using CFrame's (as smiley said). Torso.CFrame = CFrame.new(0, 0, 0). You just have to fill in the coordinates yourself. To remove the player his tools, you can use a for loop to scan through all his tools in the backpack:
F = Player.Backpack:GetChildren() for e = 1, #F do F[e]:remove() end
Then if you want to remove the tool that teleports you, you can use either script.Parent:Destroy() or script.Parent:remove()
Though you don't have to destroy the Parent anymore because the for loop I just gave you also deletes it. |
|
|
| Report Abuse |
|
|
darthpyro
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 3569 |
|
|
| 22 Jul 2013 07:59 AM |
@Zomebody,
he was spamming that across (basically) every thread on the forum. I don't suggest this all the time. Saying "free models" to every person who comes in the door isn't the answer. But it's the answer to some. |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 22 Jul 2013 08:07 AM |
| Darth, as helpful as you usually are, I don't think free models was the right answer; not this time. My method wasn't as efficient, I knew .Character was the right way to go, but I did it the other way lol. |
|
|
| Report Abuse |
|
|