Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Trying To patch a sound hack??

Im trying to make it were if someone adds a sound to the workspace that was not added to the game but was hack in it will stop or remove or destroy this what i have so far but it's not working can someone please help me?

workspace.ChildAdded:connect(function(l) if l:IsA('Sound') then l:Stop() l:Destroy() end end)

1 comment

1

Your primary solution should be to enable FilteringEnabled (See: http://wiki.roblox.com/index.php?title=Client-Server_Model_and_FilteringEnabled). This stops any client-sided change from replicating to other players.

2 answers

✓ Accepted answer

Theres nothing wrong with this, however, if someone hacks, they won't only inject into workspace, thus you'd have to link the event to every instance in the workspace.

Your issue however is that you're trying to set the parent to nil while something else has set the parent to workspace in the same tick. add a wait() and it should work.

another thing to mention: PlayOnRemove value should be set to false to make sure it wont play.

workspace.ChildAdded:connect(function(Object) 
	wait()
	if Object:IsA('Sound') then 
		Object:Stop() 
		Object.PlayOnRemove = false
		Object:Destroy() 
	end 
end)

3 comments

0

You should also suggest the use of FilteringEnabled as a primary solution, as it will filter all client-sided exploits used to make changes to the server, so they don't replicate to other users.

0

Thats what you think. People that aren't "Youtube" hackers get around that easily.

0

YouTube hackers? You're talking about someone with server-side access. Anybody with that level of control, is going to bypass all these little "security tricks" regardless. FilteringEnabled is the most secure way for a user to protect their game for the time being.

FilteringEnabled

You should want to implement FilteringEnabled for preventing such instances that you're describing. Enabling this property will prevent any change made by the client from replicating to other users. Therefore, if this "hacker" were to add a sound object to the workspace, that change would remain local to them, and the server would not be informed. Any self-made attempt to prevent an exploit should always be your last resort. In this case, FilteringEnabled will get the job done, along with protecting your game from all other client-side exploits.

Remotes

As a side note, enabling FilteringEnabled also changes how the game developer can communicate with the client/server as well. This, however, is no problem at all thanks to remotes. Remotes allow communication between the client and server by way of events and callbacks that the programmer can manipulate. As an alternative to reading about them on the wiki, I also created a video a while back on them here.

2 comments

0

You can insert anything into your character to bypass filtering enabled, just wanting to let you know.

0

Then you should use DescendantAdded, not ChildAdded.

This discussion is preserved as it was. New answers, comments, and votes are closed.