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: Equip Restrictions

Previous Thread :: Next Thread 
Epic1230 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Epic1230
Joined: 07 Dec 2011
Total Posts: 289
07 May 2013 05:15 PM
Bump
Report Abuse
Epic1230 is not online. Epic1230
Joined: 07 Dec 2011
Total Posts: 289
07 May 2013 05:18 PM
Can anyone help me?
Report Abuse
juriaan is not online. juriaan
Joined: 25 Nov 2008
Total Posts: 939
07 May 2013 05:20 PM
I already gave you all the functions.
Report Abuse
Epic1230 is not online. 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 is not online. Epic1230
Joined: 07 Dec 2011
Total Posts: 289
07 May 2013 06:51 PM
Bump.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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 is not online. 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 is not online. 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
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
08 May 2013 07:15 AM
http://wiki.roblox.com/index.php/UnequipTools_(Method)
Report Abuse
Epic1230 is not online. 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 is not online. 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
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