I need some major assistance with making NPC employees do tasks like cleaning, restocking, etc. These can be upgradable, increasing the speed and capacity they work at.
I am mainly looking for a script(s) that can execute these tasks as mentioned above and also how I would link things to a GUI Which would have the purchase NPC and upgrade panel.
you can’t ask for scripts, this category is for assisting with problems with your scripts. to add upgradables to the npc, simply use your common sense and for faster walkspeed, change the humanoid’s walkspeed and for restocking and cleaning, change the value that determines the speed respectively
you can make it fire a remote function in the client which contains the necessary parameters
pseudocode in the server:
EmployeeUpgradeRequest.OnServerInvoke = function(sender: Player, npc: Model, task: string)
-- some function that checks if the employee is the player's employee to avoid exploiters trying to sabotage others
local IsValidOwnership = GetEmployeeOwnership(npc) == sender
if not IsValidOwnership then return false, "Invalid ownership" end
local CurrentTaskLevel = GetEmployeeTaskLevel(npc, task)
SetEmployeeTaskLevel(npc, CurrentTaskLevel + 1)
return true, `{npc.Name} is now {CurrentTaskLevel+1}`
end
Thank you very much for your response I do appreciate it a lot.
In terms of your first point, I wasn’t asking for a script, I know it does sound like that but it’s just the way I phrased it. What I meant was, what language of roblox lua should I use to get started on making a script like this?
For the second point, thank you very much for the advice on the remote functions, I will take that into account and the script you replied with.
thats really a vague question, those are the foundational concepts of basically every programming language, you can use those approaches (maybe more) for the task. you need to script the client-side to handle user-inputs such as listening to button clicks and getting the necessary input data to send to the server using the remote function. and the server to validate and do the requests from the client
Thanks very much for all your responses so far and your patience.
I already knew that starting this project would be extremely difficult as I don’t have a massive amount of knowledge with luau (Basic knowledge).
Do you have any suggestions on where I can learn luau so that I can wrap this concept around my head a bit more?
I really do appreciate your support with this and know that what I am asking of is, well, too much since like you stated earlier, this is just for support, not entire scripts.
P.S. I’ve tried many yt videos but they only give me short-term knowledge on some topics or rarely help with what I actually require to learn.
you could do some small projects from time to time (e.g Pathfinding AI, networking, etc) and even now im still learning new stuff, i don’t really know other advices i could give but:
try to modify the project you made/learnt with the videos, like implementing other mechanics into the project and changing the values to further understand the concepts
also try to make something without any major help (maybe allow yourself with some devforum and stackoverflow but try to not watch tutorials)
Not to break the mood here but it’s advised not to start a big project with little experience with programming. It’ll basically be a huge burden for yourself to the point you want to call it quits. On top of that, like from what @Artzified said, do small projects to slowly improve and get better. Programming requires patience and logical thinking—you can’t just think of a script like “Hey, I want this piece of code to do this and that!”, they would require extensive debugging, customizability and flexibility.
Forum-wise, don’t expect everyone to freely give out free answers (spoon-feeding), especially on #help-and-feedback. You have to learn them all by yourself (but with other resources of course) because everyone has their own styles and preferences on coding and that not all code works for everyone and not everyone would benefit from such code—it varies from projects to projects!