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: How can I make a tool that cannot be put away?

Previous Thread :: Next Thread 
brightstorm603 is not online. brightstorm603
Joined: 10 Apr 2010
Total Posts: 6807
05 Mar 2013 07:24 PM
Is there a way I can take a tool and make it so that the user cannot unequip it?
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
05 Mar 2013 07:36 PM
as long as its a tool you could do something like this in the deselect function


Humanoid:EquipTool(ToolVariable)
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
05 Mar 2013 07:41 PM
Do this:

function unequi()
tool = script.Parent
tool.Selected=true
if tool.Selected=false and tool.Equipped=false then
tool.Equipped=true
tool.Selected=true
end
end
†† LuaLearners Teacher +1 ∞ Scripting Master « ¶¶¶ Dream ¶¶¶ Walker ††

Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
05 Mar 2013 07:49 PM
Wrong. THIS is how to do it:

function UnEquip()
Tool = script.Parent
Tool.Selected = true
if (Tool.Selected == false) and (Tool.Equipped == false) then
Tool.Equipped = true
Tool.Selected = true
end
end
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
05 Mar 2013 08:03 PM
Nope, you must be so ashamed of yourself. Putting brackets at the arguments doesn't really affect it at all. And you don't have to use them, they're called conditional statements.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
05 Mar 2013 08:05 PM
@12 - You must be blind. That wasn't the only edit he made, and the spacing wasn't either. He clearly fixed your operator issue.

ElectricBlaze • Programmer • Wiki Writer | http://wiki.roblox.com/index.php/User:ElectricBlaze
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
05 Mar 2013 08:05 PM
Why are you complicating this so much?

function Deselect()
Humanoid:EquipTool(ToolVariable)
end

It is as simple as that, all it needs is a humanoid variable and a variable for the tool.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
05 Mar 2013 08:06 PM
Anyway, NEITHER of your scripts would work, because neither of those are real properties. Both are EVENTS, and technically Selected is a property for some GUI elements, but not for Tools.

ElectricBlaze • Programmer • Wiki Writer | http://wiki.roblox.com/index.php/User:ElectricBlaze
Report Abuse
brightstorm603 is not online. brightstorm603
Joined: 10 Apr 2010
Total Posts: 6807
07 Mar 2013 08:00 PM
None of these are working...

Maybe I'm just not doing it correctly, would you please explain in a bit more detail?
Report Abuse
shammakh3 is not online. shammakh3
Joined: 18 Apr 2013
Total Posts: 2
25 Jul 2014 08:42 AM
It is like this

function WhatEverYouWantToNameIt ()
script.Parent.Equipped = true
end

script.Parent.Unequipped:connect(WhatEverYouNamedTheFunction)

Long but easy to understand (simple)
Report Abuse
freekmax is not online. freekmax
Joined: 25 Feb 2012
Total Posts: 23
25 Jul 2014 02:05 PM
Or...You could try properties>lock?
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
26 Jul 2014 08:04 PM
score 1 for bumping 1 year old thread.
fgt.
Report Abuse
seliso is not online. seliso
Joined: 30 Jan 2011
Total Posts: 6443
29 Oct 2014 08:02 PM
bump lelele
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
30 Oct 2014 10:43 PM
Oh, Scripting Helpers.
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