How to hide parts

How would you go about hiding parts or models from exploiters. For example if you have secret chests how would you make sure the exploiter can’t write a script to find all chests. Is there anyway to hide the meshId of a mesh?

1 Like

As long as something is in the workspace, ReplicatedStorage, or ReplicatedFirst, exploiters will always see it & have access to change it.

The only way afaik, to hide something like that would be to put it in ServerStorage and clone it on the server & parent to workspace if a player needs to access one [essentially 100% server sided] but that’s not exactly a recommended / good thing to do… :grimacing:

There’s not exactly a way to hide meshId’s, but what I would do is if a sussy script gets added while the game is running I would just delete it instantly.

The only way to hide them would be to store them a place where only the server can access them, since exploits are client sided.

If your game is like a mining simulator, you could define which parts should generate a chest behind it upon broken, then give that chest to the client-server sided, this way the client cannot see the chest in any way until they break that certain block. You could do this with most mechanics as well such as if not mining, you could wait for a player to go through a part and generate the chest.

Are you saying that when exploiters write code in their console, that creates an actual local script somewhere in the game and furthermore it’s possible to delete it from the server?

Yes the proximity approach is the best one I can think of generally but might cause some ‘chest appearing out of nowhere’ weirdness in my game. Might just add a ton of booby trap chests outside the bounds of the map that auto-ban you

An exploiter can trigger said chests using TouchInterest, and I’m guessing with whatever ProximityPrompt has too, as I’ve never experienced said thing, it would be a less difficult task to check Magnitude whenever the ClickDetector or ProximityPrompt is fired, you could still likely add ‘Booby-Trap’ Chests, but this would negate the possibility of them figuring it out, and forcing them to teleport to said Chest for it to function.

local Detector = script.Parent
local Model = Detector.Parent

local MaxDistance = Detector.MaxActivationDistance

------// WARNING: If The Player Is Jittering On The Edge Of The Radius They'll Be Kicked If They Step Outside After Clicking, You Shouldn't Kick For This, Rather Do Nothing If Outside Bounds.\\------

script.Parent.MouseClick:Connect(function(Player)
	local Character = Player.Character

	if Character ~= nil then
		if (Character:WaitForChild("HumanoidRootPart").Position - Model.Chest.Position).Magnitude <= MaxDistance then
			print("Player In-Range For 'MaxActivationDistance'.")
		else
			Player:Kick("Too Far Away!")
		end
	end
end)

By proximity approach I meant the server only spawning in a chest when a player is near it. Your code assumes the exploiter already found the chest and is trying to trigger the proximity prompt. Im trying to avoid that in the first place.

There is no possible way to stop them from viewing where you’re assets are inside of anything besides “ServerStorage”, “ServerScriptService”

62cd2587f4b0019bbd440c6a42bb594f4c1d62b1

You can possibly make it more of a task to view, but its futile either-way, some ways you can do this, is possibly utilizing “StreamingEnabled” so its not loaded in when the player isn’t near, but I believe they can just teleport to said position to load it in, or making the Chests only appear when the specific door is opened that has them inside.

Im aware which is why im leaning towards only spawning the chest when a player is nearby. In my game you can only open each chest once so there isn’t a point in teleporting to it if you’ve already found it. I just want to avoid an exploiter who is new to the game, writing a script and opening all chests at once.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.