|
| 16 Apr 2013 05:31 PM |
repeat wait() until game.Players.LocalPlayer wait(1) local player = game:GetService('Players').LocalPlayer local MaxHealth = player.GuiStats.MaxHP.Value local WS = player.GuiStats.MaxWS.Value local Mouse = player:GetMouse() local camera = workspace.CurrentCamera local CurrentHP = player.Character.Humanoid.Health
player.Character.Health.Disabled = true player.Character:FindFirstChild("HealthScript v3.1").Disabled = true player.PlayerGui.HealthGUI:Destroy()
function MakeArms() print("No you don't need to see what this function is for. DERP") end
repeat wait() until game.Players.LocalPlayer.Character.Torso player.Character.Humanoid.Health = 50 player.Character.Humanoid.MaxHealth = MaxHealth player.Character.Humanoid.WalkSpeed = WS MakeArms()
player.Character.Humanoid.Health.Changed:connect() script.Parent.Health.Text = CurrentHP.." / "..Maxhealth
Output: 17:31:19.280 - Players.Player1.PlayerGui.MainGui.CharacterScript:8: attempt to index field 'Health' (a number value) 17:31:19.281 - Script "Players.Player1.PlayerGui.MainGui.CharacterScript", Line 8 17:31:19.281 - stack end
I would really like to know, why I can't get the script to work. |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2013 05:34 PM |
If you're trying to get rid of the HP bar at the bottom....Try this:
while true do for inx, val in pairs(game.Players:GetPlayers()) do if val:FindFirstChild("PlayerGui") then if val.PlayerGui:FindFirstChild("HealthGUI") then val.PlayerGui.HealthGUI:Remove() end end end wait() end
|
|
|
| Report Abuse |
|
|
|
| 16 Apr 2013 06:35 PM |
Nope, I'm trying to display my current amount of Health next to my Maxhealth value. But not in bars, I'm wanting to do it in a numerical way. like so :
I currently have 150 out 350 HP so I want my gui's textbox to show like so: 150/350 HP
But, I can't do that cause of the output. :/ |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Apr 2013 07:22 PM |
| Do I need to upload the gui? |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2013 07:24 PM |
Which part of the code is line 8?
|MassiveGman| Scripter & part time Professional Whistler |
|
|
| Report Abuse |
|
|
|
| 16 Apr 2013 07:32 PM |
repeat wait() GUIhere.Text = math.floor(Humanoid.Health).."/"..math.floor(Humanoid.MaxHealth) until false |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Apr 2013 03:34 PM |
| Thank you.. It's a gift, :P. |
|
|
| Report Abuse |
|
|