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: onSelected()

Previous Thread :: Next Thread 
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
16 Apr 2012 04:46 PM
Can anyone post how this function is used? like what would i put after this function
Im not requested a script, i just need some help on how i would make a tool become Nil,and i never used this function before so i need help
Report Abuse
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
16 Apr 2012 04:47 PM
http://wiki.roblox.com/index.php/Selected_(Event)

try that maybe

~Working towards that PSTF..~
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
16 Apr 2012 04:49 PM
Thank you
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
16 Apr 2012 04:52 PM
Thanks but thats when its like used, i need it as soon as a player uses it (say hits 1) it starts, not when they hold it .
Report Abuse
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
16 Apr 2012 05:04 PM
oh, just use..
if tool.Enabled == true then
code.

~Working towards that PSTF..~
Report Abuse
hyyt8 is not online. hyyt8
Joined: 02 May 2007
Total Posts: 1760
16 Apr 2012 05:07 PM
I believe that only works for hopperbins. It'd have to be a Button1Down() for a tool
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
16 Apr 2012 05:15 PM
what i kinda need is
function onSelected()
code here
script.parent:Remove

conection line goes here

Idk how to do the connection line AND how to write the code for a onSelected, i need it go nil BUT still working
Report Abuse
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
16 Apr 2012 05:17 PM
http://wiki.roblox.com/index.php/Selected_(Event)

local hop = Instance.new("HopperBin")
hop.Parent = game.Players.Player.Backpack
local function onSelected()
print("HopperBin selected")
end
hop.Selected:connect(onSelected)

~Working towards that PSTF..~
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
16 Apr 2012 05:18 PM
For tools:

script.Parent.Equipped:connect(function(mouse) end)

for HopperBins:

script.Parent.Selected:connect(function(mouse) end)
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
16 Apr 2012 05:18 PM
instance makes a new hopperbin though
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
16 Apr 2012 05:19 PM
@Raven-- thank you, now are Hopperbins working the same as tools? i mean i never learned that
Report Abuse
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
16 Apr 2012 05:20 PM
local hop = YOURHOPPERBIN

local function onSelected()
------CODE-------
end
hop.Selected:connect(onSelected)

~Working towards that PSTF..~
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
16 Apr 2012 05:20 PM
HopperBins aren't physical objects. They can be 'used', but doesn't contain handles.

They can be used more or less in the same way, though.
With MouseButton1Down and so on ;)
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
16 Apr 2012 05:21 PM
Ahh im still learning about KeyDown and all that for tools,im hoping to learn tonight,and thank you for all your help
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