Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why doesn't my custom health bar work properly in a real server? [Filtering not enabled]

I made a custom health bar and it works fine when I'm using roblox studio's server test mode but when I actually activate my game and play on a real server the health bar screws up. I tool screen shots so you can see what I mean.

In studio's server test mode: http://imgur.com/a/R5UOj

On a real server: http://imgur.com/a/PHnx3

Local Script inside Frame:

wait() 
local Player = game:GetService'Players'.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Human = Character:WaitForChild("Humanoid")

local HealthFrame = script.Parent

Human.HealthChanged:connect(function(Health)
	HealthFrame.Size = UDim2.new(Health/Human.MaxHealth / 3.7,10,0.15,0)
end)

Frame Size: {0, 305},{0, 42} Frame Position: {0, 28},{0, 33}

Thanks!

3 comments

0

Is the Green Bar inside of the red bar frame?

0

Because we are basically have the same concept but yours popout for some reason or you have higher zindex

0

The green bar is not inside the red bar frame, they are both in a screen gui together. The zindex for the green bar is 2 and for the red bar its 1.

1 answer

RIP XD, Look at line 1.

game:GetService'Players'
-- should be
game:GetService('Players')
--or
game:GetService("Players")

This discussion is preserved as it was. New answers, comments, and votes are closed.