r/roblox•
Spectrabox

Scripted Local Objects

Question

Hi, I was wondering if anybody knew of a way to do local scripted objects with Filtering Enabled on. Spawning in objects with a local script will create them for one player, which is what I want, but this doesn't work when it comes to things like NPCs, or really anything intractable as scripts do not run. Does anybody know of a way to accomplish this?

I tried spawning in the object for everybody, then deleting it for everyone who is not the target player, but destroying objects through local scripts does not seem to work.

Posted Jan 4, 2017, 7:27 PM UTC

14
FuriousProgrammer•

I'm not sure what's not working for you here?

LocalScripts and Scripts need not be Parented to the objects they are 'working' on in order to function. What exactly are you trying to do?

1
SpectraboxOP•

Let's say I have a zombie I want to spawn for only one player. If I spawn him from a local script none of his own behavior scripts will run as they are inside of him. He also doesn't exist to the server at this point so no external regular scripts could affect him either as far as I know.

I realize he could potentially be controlled by a local script, but since he doesn't exist on the server nothing he does can be really be verified. For example the server cannot know if the zombie is killed so it relies on information from the client, and (maybe I am wrong on this) exploiters could send any information they wanted basically telling the server they killed it without actually killing it.

I am basically looking for a way for an object to exist on the server and one player's client so it can be interacted with and verified by the server and target client, but not other clients.

1
FuriousProgrammer•

What I would do in this case is have the server handle the logic of everything.

The zombie exists on the Server, but only in Code. If a bullet hits the zombie, the Server is what deals the damage, if the bullet is "legal".

2
SpectraboxOP•

I could see something like that working, I'll give it a try. Thanks.

1