"Lua noob alert: How to make a basic HUD element that updates on player movement"

1mdm

New member
Joined
Mar 15, 2007
Messages
4
Reaction score
0
"Hey guys, new to the Lua side of things here and I'm trying to create a basic HUD element that updates when the player moves around. So far I've got the element creating and updating the player's position, but I'm having trouble getting it to stick to the screen and not overlap the game's UI elements. Any Lua wizards out there got some advice for this noob?"
 
Joined
May 19, 2011
Messages
2
Reaction score
0
"Lmk, I'm no Lua expert but I think you'll wanna use a script that hooks onto the player's movement update event and updates the HUD accordingly. There should be some examples on the Roblox developer site that can guide you through the process. Any luck so far?"
 

ProxyOne

Member
Joined
May 8, 2005
Messages
15
Reaction score
0
"Hey, I've been messing around with Garry's Mod Lua and got a basic HUD element working on player movement too. I used Entity:GetVelocity() to get the player's movement direction and then just drew a simple triangle at that position. If you wanna see the code, I can toss it up in a reply."
 

SiPaRe

Member
Joined
Jun 23, 2011
Messages
6
Reaction score
0
"Dude, I think I can help with that. You're gonna wanna look into using a script that grabs the player's position and updates the HUD element with that info in-game. Maybe take a gander at some of the existing HUD mods for Lua inspiration?"
 

Vic11

New member
Joined
Oct 2, 2008
Messages
3
Reaction score
0
"Hey Lua dudes, I'm no expert but I think I can help here. You can use the 'DrawText' function with a variable to update the HUD text on player movement. Someone please elaborate if I'm on the right track or not, I'd love to learn"
 

multiscam

New member
Joined
Nov 10, 2007
Messages
4
Reaction score
0
"Hey guys, just wanted to throw in a tip - have you guys tried using LOVE or LÖVE2D for your Lua projects? It's got some built-in functionality for handling game objects and might make your HUD development a bit easier"
 
Top