Suggestions/Methods for a PC Hacking System

Just would like to say I’m not entirely sure where this post belongs, but it seems like it would belong here, so apologies if it does not.

If you’ve played Flee The Facility on ROBLOX before, then you know how you need to hack computers to gain access to exits to escape the facility. I kind of need help deciding or figuring out what methods I should use or how someone who is more experienced might go about doing it. I’ve already really formed my own draft, but unfortunately, for me, it’s a complete mess really, and can bug probably at least occasionally and I’m sure there are many ways it could be exploited. It’s primarily a bunch of loops and utilizing the RunService without any breaks. If that doesn’t quite sound bad enough, there is almost up to 350 lines of code per a PC.

Keep in mind I’m not worried about the whole exit thing or anything else related to Flee The Facility, just the computers how and they’re “hacked”.

I’d appreciate some ideas or responses. If you need more elaboration I will do exactly that.

You can use the CollectionService to write code for all PCs in just one component.

1 Like

I’ve never utilized that service, would you like to give a background on how it’d be helpful to me? Or, should I just look it up.

You can assign ‘tags’ to repeating entities (your PCs for example). Here is a guide. The idea is that you do not have to replicate your scripts to every single PC.

1 Like

I think I might be getting some where with that, something like this would probably definitely free up server resources, and prevent lag?

I’d assume, since the loops are always running even if players are not at the computer.

You can use it on both the client and the server. In this case, you should make it a server component as a PC is not directly related to a specific player.

Performance is not the main goal here. It is rather to make development more pleasant and less tedious.

I would use ProximityPrompt for communicating with players. From there, you can do whatever (maybe implement some hacking UI) and finally validate if the hack worked or failed.

1 Like

Yeah I got a progress bar UI that runs for computers that does function correctly,
image

I also use ProximityPrompts for interaction with the Computer as it’s simple and easy.

However regarding the ProgressBar, I do sort of have an issue, the Server fires all the clients telling them what the progress is, something like this,

Remotes.ProgressBar.OnClientEvent:Connect(function(progress)
	local NeededProgress = 360
	local currentProgress = progress/NeededProgress
	local roundedProgress = math.round(progress)
	
	ProgressBar.Size = UDim2.fromScale(currentProgress, 0.05)
	GUI.Percentage.Text = tostring(roundedProgress) .."%"
end)

Realize how NeededProgress is set to 360. It’s the only way to make the bar stop growing after what appears would be 100%. I can’t set it to 100 or else it breaks. Any Ideas?

Eh idk, but I would probably insert another UI element within the bar and give it a scale of 1 by 1. Then you can use set the ratio of progress and maxProgress to the X scale.

1 Like

Alright, will give it a shot. Any other suggestions really?

Thanks for informing me about the CollectionService, it is actually very helpful and it works just as intended!

1 Like