[Fixed] Height Bar Script

I want to Script a HeightBar like the HeightBar in Tower Of Hell with which we can see the height of other players and our own height.

I thought of every possible way to script it but it didnt work.

I have searched on DevForum and YouTube , i got only the Scripts with which we could only see our own height.

Edit : i dont need the height script i just want to know how we get all the players thumbnail and clone then to all clients.

If u have any suggestions or ideas on how to script it pls inform me.

Thank you for reading :slight_smile:

ok so what you can do is basically on a vertical axis calculate the players position relative to the origin point of whatever u want, since im typing this on my phone i cant really provide any code other than maybe gather all players, find the position relative to a base point, then runservice.stepped the position and scale it on a gui based on where it is on that specific axis i think?

how id go about this is basically keep updating via what i recommended above, find the characters primarypart Y position / Y max gui size and create a gui part specifically for the player onto the bar, and find a way to scale it properly with a sort kf equation: when i get home i can experiment on studio and come up with something for you

2 Likes

get the player’s thumbnail, divide the player’s y position by the max Y position of the tower and make a frame for that sepecific player on that position

1 Like

Here’s an example code, I suck at explaining:

local Height = 50; -- or you can just define the position Y axis of your part

local function returnPercentage()
    return (1 - HumanoidRootPart.Position.Y/Height);
end

-- Now you can position the GUI at the correct place:

GUI.Position = UDim2.new(GUI.Position.X.Scale, 0, returnPercentage(), 0);

Hope this helps!

3 Likes

Thanks for your effort but i already have that script

local player = game.Players.LocalPlayer
local ThumbnailType = Enum.ThumbnailType.HeadShot
local thumbnailSize = Enum.ThumbnailSize.Size150x150

run.RenderStepped:Connect(function()
	script.Parent.Name = player.Name
	local ThisPlayer = players:FindFirstChild(script.Parent.Name)
	script.Parent.Image = players:GetUserThumbnailAsync(ThisPlayer.UserId,ThumbnailType,thumbnailSize)
	for i ,v in pairs(players:GetChildren())do
		local playerGui = v:FindFirstChild("PlayerGui")
		repeat wait() until v:FindFirstChild("PlayerGui"):FindFirstChild("Height")
		local ImageLabel = script.Parent
		local Character = game:GetService("Workspace"):FindFirstChild(v.Name)
		repeat wait() until player.Character
		local PrimaryPart = Character:FindFirstChild("HumanoidRootPart")-- common for r6 and r15
		repeat wait() until Character:FindFirstChild("HumanoidRootPart").Position
		wait(.1)
		local Height = math.ceil(PrimaryPart.Position.Y)
		ImageLabel.Position = UDim2.new(-(0.043- Height / 335), 0, -1.536 , 0)
	end
end)

i need to know how we will clone it to all clients . i tried looping through all players but its still not working

You should use RemoteEvents and FireAllClients() with all the information you stored in this script

1 Like

What all information should i pass through the server to client . Can u specify the parameters please.

All information related to the magnitude, an example should be

Event:FireAllClients(Height,Position1,Magnitude,etc)

1 Like

i can get that locally too right? , i need to know how we clone a particular player’s thumbnail pic to all other players.

Yes, you can do that, firing all clients just will show all local information you stored to everyone

1 Like

Ok , Thanks for ur help i will test and tell the outcome. :grinning:

Good Luck! Im sure this will help

1 Like

Here is a height bar GUI I made. It can be a bit glitchy heightGUI.rbxm (6.9 KB)