Hello, I am currently making a horror game inspired by Flee the Facility (game here), A huge part of the game is to allow a player to complete an objective in-order to escape as a survivor, and I am wondering how I can set up something like this?
I am considering adding scripts, objects, etc in the map and adding a folder that will be replicated into the player so it allows them to actually do objectives. But if there is an alternative or just a better way of doing so?
Any help is appreciated and ask me questions if you need a better explanation.
2 Likes
▸ Creating Information
I would first of all create a Module containing information about the quest. These include their text, rewards, requirements, etc. I would then create a Folder inside 1 of 2 locations.
- Create a folder inside the player for easy accessibility.
- Create a folder inside ServerStorange for security reasons.
▸ Storing Information
I would then construct an algorithm to make secure datastore saves and a queue system to help double-check and save correctly. Along with this, I would add the requirement check system.
▸ Obtaining Information
Using protected functions I obtain the data in table forms and place them inside their designated locations. If it has been done but not claimed I would then immediately fire a remote event to tell the server that it’s claimable.
▸ Displaying Information
If you were to take method 1 you would just use:
local Objectives = game.Players.LocalPlayer.ObjectivesFolder -- Client
local Objectives = game.ReplicatedStorage.RemoteFunction.OnServerInvoke = function(plr) return plr.ObjectivesFolder end)
If you were to take method 2 you would use:
local Objectives = game.ReplicatedStorage.RemoteFunction.OnServerInvoke = function(plr)
return game.ServerStorage.PlayerObjectives[plr.Name..ObjectivesFolder]
end)
Then using some kind of UI I would just go through all the objectives with a for loop and display the text/rewards and if it has been completed.
▸ Additional Information
If you want a full tutorial about this be sure to let me know and I’ll give you a detailed overview of how I would make this exact system.
3 Likes
Why would I use a remote function for displaying the information?
1 Like
If I have UI that’s trying to see the objective rewards, text, progress, etc. Then I’ll need to obtain the information and use RemoteFunctions which means I can return and use it in the client as such:
local ObjectivesFolder = game.ReplicatedStorage.RemoteFunction:InvokeServer()
-- This goes through the process of obtaining the folder and then makes this variable the folder contents.
-- You don't need to do this if you're making it client sided.
- Side-Note: You’ll have to return the data in table form if it’s placed in ServerStorage or just locate their folder directly if it’s in ReplicatedStorage.
1 Like