Hi, I'm trying to remove parts on the client for only 1 person. I've used RemoteEvents, but it didn't work. What is the best way to do this?
✓ ANSWER ACCEPTED
I just want to remove parts on the client for certain people, how?
1 answer
✓ Accepted answer
server
local Remote = path.to.remote
local PartToDestroy = path.to.part
local PlayersToRemovePart = {'Player1', 'Player2'}
function foundValueInTable(tbl, value)
for i,v in pairs(tbl) do
if v == value then
return tbl[i]
end
end
end
function send()
for i,v in pairs(game.Players:GetPlayers()) do
if foundValueInTable(PlayersToRemovePart, v.Name) then
Remote:FireClient(v, PartToDestroy)
end
end
end
-----------------------------
client
local Remote = path.to.remote
Remote.OnClientEvent:Connect(function(part)
part:Destroy()
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
call send() when you want to remove the part
change remote to the remote event, change partToDestroy to the part you want to destroy
add a players name to the playersToRemovePart array
I already know, thanks!
no problem.