Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
|
| 07 May 2013 03:36 PM |
| How can I make it so that only a certain player can equip a tool? |
|
|
| Report Abuse |
|
|
Flash77
|
  |
| Joined: 14 Jun 2008 |
| Total Posts: 550 |
|
|
| 07 May 2013 03:50 PM |
add an if statement checking if that is the correct player that is holding the tool
or
give only that person a tool |
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
|
| 07 May 2013 03:54 PM |
| So, I make an if statement if a player is holding the tool. Then what? How do I make it so that the tool go back to his Backpack? |
|
|
| Report Abuse |
|
|
juriaan
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 939 |
|
|
| 07 May 2013 03:56 PM |
PlayerList = {"Playername", "Playername"}
function IsPlayer(Obj) for i = 1,#PlayerList do if Obj.Name == PlayerList[i] then return true end end return false end
Game:GetService("Players").PlayerAdded:connect(function(new) if IsPlayer(new) then print("Player is allowed to get the weapon !") new.CharacterAdded:connect(function() Tool = Game:GetService("Lighting")["ToolName"] Tool:clone().Parent = new.Backpack end) end end)
That would do the trick I believe.
|
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
|
| 07 May 2013 04:01 PM |
| I want it to be like.. You can still have your tool in your backpack, but only a certain player can equip that tool. So when they try to equip it, it won't work. |
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
| |
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
| |
|
juriaan
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 939 |
|
|
| 07 May 2013 05:20 PM |
I already gave you all the functions.
|
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
|
| 07 May 2013 05:27 PM |
| But I want it so that you CAN'T equip the tool unless you are that person. Not clone the tool when someone enters. |
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
| |
|
|
| 07 May 2013 06:54 PM |
What's the difference? Only player's in the table are allowed to get the tool. |
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
|
| 08 May 2013 07:08 AM |
| I'm trying to make this RPG game, and only certain players can equip it. If you aren't that certain player, you can still sell the tool. |
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
|
| 08 May 2013 07:09 AM |
| Is it possible so that when you equip it, the tool clones into their backpack, and removes the tool? Will that work? |
|
|
| Report Abuse |
|
|
|
| 08 May 2013 07:15 AM |
| http://wiki.roblox.com/index.php/UnequipTools_(Method) |
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
|
| 09 May 2013 07:03 AM |
So.. Would it be like
script.Parent.Equipped:connect(function() if game.Players.LocalPlayer.Name ~= "Epic1230" then script.Parent:UnequipTools() end end)
Would that do the trick? |
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
|
| 09 May 2013 07:04 AM |
Forgot something..
script.Parent.Equipped:connect(function() if game.Players.LocalPlayer.Name ~= "Epic1230" then game.Players.LocalPlayer.Character.Humanoid:UnequipTools() end end) |
|
|
| Report Abuse |
|
|