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: HELP - Visible for Admins Only

Previous Thread :: Next Thread 
TheSoMekTime is not online. TheSoMekTime
Joined: 14 Mar 2009
Total Posts: 191
21 Mar 2012 11:28 AM
How would I make this script only function for specified names only?

game.Players.PlayerAdded:connect(function(pl)
pl.CharacterAdded:connect(function(char)
repeat wait() until char:FindFirstChild('Humanoid')
local hum = char.Humanoid
hum.Changed:connect(function(p)
if p == 'Health' then
print(pl.Name..'\'s health is: '..pl.Health)
end
end)
end)
end)
Report Abuse
TheSoMekTime is not online. TheSoMekTime
Joined: 14 Mar 2009
Total Posts: 191
22 Mar 2012 02:53 PM
I am thinking of adding a table but I'm not very good with tables and I want to get help for it.
Report Abuse
TheSoMekTime is not online. TheSoMekTime
Joined: 14 Mar 2009
Total Posts: 191
23 Mar 2012 01:09 AM
BUMP
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
23 Mar 2012 01:10 AM
You havent' defined pl in line 2.
Report Abuse
TheSoMekTime is not online. TheSoMekTime
Joined: 14 Mar 2009
Total Posts: 191
23 Mar 2012 01:23 AM
Really? It still works, I've tested it, I just want to figure out a way for only certain players to see the different players health changed. Would this work?

allowed = {["TheSoMekTime"] = true
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
if allowed[player.Name] then
game.Players.PlayerAdded:connect(function(pl)
pl.CharacterAdded:connect(function(char)
repeat wait() until char:FindFirstChild('Humanoid')
local hum = char.Humanoid
hum.Changed:connect(function(p)
if p == 'Health' then
print(pl.Name..'\'s health is: '..pl.Health)
end
end)
end)
end)



Report Abuse
iHeal is not online. iHeal
Joined: 24 Jan 2011
Total Posts: 6
23 Mar 2012 10:01 AM
Try the IfNotAllowedIn function, also don't be afraid to study Person299's admin script. Its how I learned that function and it is very useful.
Report Abuse
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
23 Mar 2012 10:08 AM
Allowed = { "dog", "DragonFang1" }--just as an example so you know how to add more names

game.Players.PlayerAdded:connect(function(pl)
pl.CharacterAdded:connect(function(char)
for _,v in ipairs(Allowed) do
if pl.Name==v then
repeat wait() until char:FindFirstChild('Humanoid')
local hum = char.Humanoid
hum.Changed:connect(function(p)
if p == 'Health' then
print(pl.Name..'\'s health is: '..pl.Health)
end
end
end
end)
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