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

filteringenabled messing stuff up?

I don't really get how FilteringEnabled works. I have this code, which is supposed to handcuff someone and move them. However, this doesn't work. It works fine on my screen, but it doesn't update on their screen, and when I release the cuffs they go back to where they were.

script.Parent.Equipped:connect(function(m)
m.Button1Down:connect(function()
if m.Target~=nil then
print(m.Target:GetFullName())
p=nil
_,p=pcall(function() return game.Players[m.Target.Parent.Name] end)
print(p)
print(m.Target.Parent.Name)
if p~=nil then
local detained=p
coroutine.wrap(function()
        local c=p
        while p==c do wait() pcall(function()
                p.Character.Torso.Anchored,p.Character.Torso.CFrame=true,game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,0,-2.5)
        end) end
        print('END OF DETAIN LOOP')
        pcall(function() c.Character.Torso.Anchored=false end)
end)()
else print('no p') end
end
end)
end)

2 comments

0

when you don't know how filteringenabled works

1 answer

✓ Accepted answer

Filtering Enabled is a security measure. It keeps things from the client from replicating on the server.

What does this mean?

This means that if you have FilteringEnabled set to false then if you was to pick them up and move them on your screen... and let them go.. then they would be at that position.

It means that effectively what's happening in your game is happening in theirs.

When FilteringEnabled is set to true.. then Nothing happens on anyones game. Things happen on the server.. and the server sends those actions to each client.

Example Filtering Enabled is off You create a new part locally... it creates it for every person in the game.

Filtering Enabled On You create a part locally.. its only created for you, no one else can see it or interact with it.

To get around this in Filtering Enabled you would use Events..

You can see them in action HERE

And you can get a more indepth explanation HERE.

Clients can get parts near them assigned to them (NetworkOwnership). When this happens, whatever happens on that client will be propagated to the server and other clients. Explained Here

Credits to @chess123mate for NetworkOwnership

1 comment

1

I agree with your answer, except this minor detail: clients can get parts near them assigned to them (NetworkOwnership). When this happens, whatever happens on that client will be propagated to the server and other clients. See http://wiki.roblox.com/index.php?title=Network_ownership

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