emite1000
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 46 |
|
|
| 28 Jun 2013 11:38 AM |
What would I put in this function to make it so that when a player touches a tool, they don't pick it up?
function onTouch(part) --What goes here? end brick.Touched:connect(onTouch)
(I already have another script that makes the player pick it up when they click it, so don't tell me to do something like delete the handle.) |
|
|
| Report Abuse |
|
|
emite1000
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 46 |
|
|
| 28 Jun 2013 11:39 AM |
Actually it looks like this:
function onTouch(part) --What goes here? end RayGun1.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2013 11:39 AM |
| why not delete the touchtransmiter? |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2013 11:41 AM |
| or you could parent the handle to something other than the Tool and when the player clicks the handle creates a new tool, clones itself into it and parents it to your backpack. |
|
|
| Report Abuse |
|
|
emite1000
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 46 |
|
|
| 28 Jun 2013 11:45 AM |
Deleting Touchtransmitter: I tried that. It didn't work.
Making a clone script: I'm a beginner scripter, so I don't know how to make something that complicated. |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2013 12:05 PM |
| post the click script here, ill help u |
|
|
| Report Abuse |
|
|
emite1000
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 46 |
|
|
| 05 Oct 2013 07:01 PM |
My click script is:
local gun = Workspace.RayGun1 function onClicked (player) gun.Parent = player.Backpack end gun.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
emite1000
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 46 |
|
|
| 05 Oct 2013 07:24 PM |
| Also, why does deleting the TouchInterest not work? |
|
|
| Report Abuse |
|
|
emite1000
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 46 |
|
| |
|
emite1000
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 46 |
|
| |
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 07 Oct 2013 09:06 PM |
| Because as long as something's waiting for the .Touched event, it'll create a new touchinterest |
|
|
| Report Abuse |
|
|
Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 07 Oct 2013 09:11 PM |
| Theres a property of the tool that doesnt let you pick it up. |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2013 09:33 PM |
| /\ or likewise you could parent it back to wherever it was before it was touched. (Probably really glitchy though) |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2013 09:43 PM |
| Best way is to make a model of it, not an actual tool, and upon clicking the model it clones the actual tool from wherever it's stored and deletes the model. |
|
|
| Report Abuse |
|
|
emite1000
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 46 |
|
|
| 08 Oct 2013 10:11 PM |
| I only want the players to be able to pick up one gun though. Not be able to spam and get a million of them. Cloning it wouldn't work then, unless there is a way to add a timer into ROBLOX scripting. |
|
|
| Report Abuse |
|
|
emite1000
|
  |
| Joined: 11 Mar 2011 |
| Total Posts: 46 |
|
|
| 08 Oct 2013 10:20 PM |
| Oh I forgot I can use wait (x). So how would I make a clone script? |
|
|
| Report Abuse |
|
|