RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 13 Aug 2016 04:12 PM |
local player = game.Players.LocalPlayer local gui = game.ReplicatedStorage.GUI:Clone() local text = gui:WaitForChild("TextLabel") ------------------------------------------------------------------------------------------------------------------------------
workspace:WaitForChild(player.Name)
gui.Parent = workspace:FindFirstChild(player.Name) gui.Adornee = player.Character.Head player.Character.Humanoid.NameDisplayDistance = 0 player.Character.Humanoid.HealthDisplayDistance = 0 player.Character.Humanoid.DisplayDistanceType = "None" local hum = player.Character.Humanoid
local adminNames = { RobuxLife = true, Player1 = true, }
function isPlayerAdmin(playerName) return adminNames[playerName] or false end
if isPlayerAdmin(player.Name) then -- print(player.Name .. " is an admin") text.Text = "Admin: "..player.Name.. " Health: "..hum.Health text.TextColor3 = Color3.new(255,255,0) hum.Health.Changed:connect(function() text.Text = "Admin: "..player.Name " Health: "..hum.Health end) else -- print(player.Name .. " is a player") text.Text = "Player: "..player.Name.."Health: "..hum.Health text.TextColor3 = Color3.new(255,255,255) hum.Health.Changed:connect(function() text.Text = "Player: "..player.Name " Health: "..hum.Health end) end
In the output, I get
17:11:23.207 - Players.RobuxLife.PlayerScripts.LocalScript:28: attempt to index field 'Health' (a number value) 17:11:23.207 - Stack Begin 17:11:23.208 - Script 'Players.RobuxLife.PlayerScripts.LocalScript', Line 28 17:11:23.208 - Stack End
so the health is changing
|
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 13 Aug 2016 04:14 PM |
Sorry, *so the health ISN'T changing
|
|
|
| Report Abuse |
|
|
|
| 13 Aug 2016 04:16 PM |
| Make player and hum not local |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 13 Aug 2016 04:22 PM |
17:18:07.099 - Players.RobuxLife.PlayerScripts.LocalScript:28: attempt to index field 'Health' (a number value) 17:18:07.099 - Stack Begin 17:18:07.100 - Script 'Players.RobuxLife.PlayerScripts.LocalScript', Line 28 17:18:07.100 - Stack End
is EXACTLY what the output says.
|
|
|
| Report Abuse |
|
|