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 do you make a tool available to only admins?

Previous Thread :: Next Thread 
iara56 is not online. iara56
Joined: 23 Nov 2012
Total Posts: 1032
02 Jul 2014 10:18 AM
Please I've been looking for this answer for a good amount of time now.
Report Abuse
iara56 is not online. iara56
Joined: 23 Nov 2012
Total Posts: 1032
02 Jul 2014 10:19 AM
Such as a taser only for admins.
Report Abuse
Barite is not online. Barite
Joined: 25 Jun 2014
Total Posts: 1319
02 Jul 2014 10:21 AM
playeradded
loop through table of admins
clone tool from replicatedstorage into player backpack
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
02 Jul 2014 10:25 AM
Admins = {"PlayerNameHere","PlayerNameHere","PlayerNameHere"}
PlayerToBeChecked = game.Players.LocalPlayer
function PlayerCheck()
for _,v in pairs(Admins) do
if PlayerToBeChecked ~= v then
script.Parent.Enabled = false
end
end
end
script.Parent.Equipped:connect(PlayerCheck)
The above script should be placed in the LocalScript of the tool, just add the admin's name into the list of admins.
Report Abuse
iara56 is not online. iara56
Joined: 23 Nov 2012
Total Posts: 1032
02 Jul 2014 10:26 AM
@anony
Thanks, your post really helped.
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
02 Jul 2014 10:48 AM
local admins={'COOLDUDE11OO';'Someone'}

local isAdmin=function(string)
if type(string)=='String' then
if string.match(table.concat(admins,' '),string) then
return true else return false
end
end
end

game:service'Players'.PlayerAdded:connect(function(p)
if isAdmin(p.Name) then
game:service'Lighting'['Tool']:Clone().Parent=p:WaitForChild'StarterGear'
game:service'Lighting'['Tool']:Clone().Parent=p:WaitForChild'Backpack'
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