|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 25 Feb 2012 |
| Total Posts: 23 |
|
|
| 25 Jul 2014 02:05 PM |
| Or...You could try properties>lock? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 6443 |
|
| |
|
| |
|