Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Overhead HP bar Surface properties inlet and studs?

Asked by 7 years ago

I have an overhead hp bar for an rpg and you can clearly see that there is studs on the hp bar. how would i make this property "smooth" instead of "studs" by adding some lines of script?

01print 'Hello world!'
02 
03--Created by XanthicDragon
04--Inspired by "Sword Art Online: Burst"
05 
06game:GetService("StarterGui"):SetCoreGuiEnabled("Health", false)
07 
08 
09local Players = game:GetService("Players")
10local Player = Players.LocalPlayer
11local Character
12repeat
13    wait()
14    Character = Player.Character
15until Character
View all 63 lines...

2 answers

Log in to vote
0
Answered by 7 years ago

Added a set of property modifications regarding the surfaces not being smooth for your script... I noted them with comments

01print 'Hello world!'
02 
03--Created by XanthicDragon
04--Inspired by "Sword Art Online: Burst"
05 
06game:GetService("StarterGui"):SetCoreGuiEnabled("Health", false)
07 
08 
09local Players = game:GetService("Players")
10local Player = Players.LocalPlayer
11local Character
12repeat
13    wait()
14    Character = Player.Character
15until Character
View all 79 lines...

This is one of the ways you can do this. Alternatively, you can have the bricks already made prior and simply clone them from a folder or lighting or w/e people store stuff in these days.

example:

1local red = game.ServerStorage.Folder.red:Clone()
2local green = game.ServerStorage.Folder.green:Clone()

of course, the folder isn't necessary but it'd look nicer.

I cant guarantee that the cloned variables won't bug out if you decide to mess with its CFrame and whatnot, but give it a shot if you find the first solution unappealing.

Ad
Log in to vote
0
Answered by 7 years ago

You can set the surface type of a part by using something like the following.

1part.TopSurface = Enum.SurfaceType.Smooth
2-- but, you can also declare it as a string.
3part.TopSurface = "Smooth"
4-- or use the Enum value
5part.TopSurface = 0

The surface property names for all BasePart classes are TopSurface, BottomSurface,LeftSurface, RightSurface, BackSurface, and FrontSurface. BasePart BasePart is the base class for physical parts such as Part, WedgePart, MeshPart, and more.

Enum.SurfaceType reference: http://wiki.roblox.com/index.php?title=API:Enum/SurfaceType

BasePart reference: http://wiki.roblox.com/index.php?title=API:Class/BasePart

Answer this question