I'm new to lua and would like to make this for my scavenging/roleplaying gamemode, and all attempts I've tried at it failed miserably.
Basically, there'd be nothing on your screen except the chatbox, so you could see other player's messages and stuff. There would be no Q menu, to spawn a prop you would type something like rp_scavenge in the console, and a little menu would come up where you'd search for a prop. It would then say "You scavenge a *propname* from the ground." It could have little messages after that, like "You wipe some dust off of it."
For the toolgun, not all tools would be available, but only ones that could be real life things. Weld would be nails, color/material would be a paintcan, rope/pulley would be, well, rope. You could scavenge nails, and your weld toolgun would come up. You get the picture.
Anyway, I tried this, but I got constant lua errors. (this was about a month ago.) I couldn't figure out how to hide the HUD for all players, and have only the chatbox/weapon be seen. I also couldn't figure out how to do the scavenging thing, or even create a menu.
I probably failed miserably because I copied code from youtube tutorials, and didn't try to learn it on my own, and forgot the commands an hour later...but could anyone help me on this?
This is the code I was trying to hide the HUD with, except for the chatbox.
[lua]function hidehud(name)
for k, v in pairs("CHudHealth", "CHudBattery") do
if name == v then return false end
end
end
[/lua]
Could anyone...fix that? :ohdear: It doesn't do anything. I'd perfer if I could add someone to Steam since there's a lot of you really good lua people here, because I want to actually learn the stuff and not seem like I am asking people to code it for me.
Any help is appreciated. :ohdear:
Problem with that code is, you're sending those as arguments instead of a table.
[lua]for k, v in pairs{"CHudHealth", "CHudBattery"} do [/lua]
Should work.
You can [url=steam://friends/add/76561197999132661]add me on steam[/url], if you'd like more help.
Sorry, you need to Log In to post a reply to this thread.