generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Touching not grabbing

Previous Thread :: Next Thread 
emite1000 is not online. 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 is not online. 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
vampirexevipex is not online. vampirexevipex
Joined: 11 Apr 2009
Total Posts: 1598
28 Jun 2013 11:39 AM
why not delete the touchtransmiter?
Report Abuse
vampirexevipex is not online. vampirexevipex
Joined: 11 Apr 2009
Total Posts: 1598
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 is not online. 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
vampirexevipex is not online. vampirexevipex
Joined: 11 Apr 2009
Total Posts: 1598
28 Jun 2013 12:05 PM
post the click script here, ill help u
Report Abuse
emite1000 is not online. 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 is not online. 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 is not online. emite1000
Joined: 11 Mar 2011
Total Posts: 46
05 Oct 2013 08:07 PM
Bump
Report Abuse
emite1000 is not online. emite1000
Joined: 11 Mar 2011
Total Posts: 46
07 Oct 2013 09:03 PM
bump again
Report Abuse
janthran is not online. 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 is not online. 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
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
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
ilikepiehaha is not online. ilikepiehaha
Joined: 02 Aug 2011
Total Posts: 316
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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image