Hey everyone,
How would you implement the following? I’m making a minigame game where I’m planning to have different mechanics the player can use. For example, in one minigame the player will be able to punch others by pressing the ‘E’ key. In another minigame, the player will instead have the option to press LMB to take a picture of someone, etc.
I’ve been thinking about it and I thought of having multiple local scripts stored somewhere (like in ReplicatedStorage) and whenever I need a mechanic like the PunchScript, I’ll just copy it and put it inside the player’s backpack, then once the minigame’s over, delete said script from their backpack. What are your opinions on this method?
EDIT: I don’t need help implementing the punching/picture mechanic. I’m asking for your thoughts on the copy and pasting local scripts into players’ backpacks so they can use certain mechanics.
I would do the same cause i’m not an profesional at scripting cause i only learned the basics and i am now training on more stuff but i gues if it does hes job and you make all the scripts look nice i gues it’s good.
also a question if you know how to learn scripting faster pls tell me it’s hard and i’m looking for it.
I believe you could store a billboard gui in the players torso, and tween it to size when a player comes within the range for it to show up. Then again, I don’t know if you want to do that.
Continuing, don’t rely on putting scripts back and forth. That will cause the script to become exhausted due to the amount of requests that may put strain on the server.
Try detecting if the mouse comes in range within a user for the picture method, and etc.
Hey Messeras, thank you for your answer
Sorry if I wasn’t detailed enough in my first post, I don’t need help with each specific mechanic. What I’d like to know is if I should put each mechanic inside a different local script.
This means that the whole punching mechanic will be in local script #1, the camera mechanic will be in local script #2 and so on. (originally placed inside ReplicatedStorage, where they’ll be innactive)
When a minigame starts which involves punching other players, I would copy local script #1 and paste it inside every player’s backpack, once it’s over delete it.
What do you think about this?
All right thank you.
Though what would be the difference between inserting a tool and only a local script? After all, a tool usually has a local script inside right?
The difference is that the tool can be activated on equip, the script will run in that said storage. Not the best idea to have a script exhaust itself inside of the storage area so it breaks on insertion.