Hello all, i’m need help
I’m trying to find how to make team-only visible brick/part
Example: If your team is Survivors, then part is not visible for you, and you can’t touch it.
If your team is Infected, then part for you is visible and you can touch it.
Please help who have time, i have no idea how to do that
game.Players.PlayerAdded:Connect(function(plr)
local team = plr.Team
if team == game.Teams.YOURTEAM then part.Transparency = 0 ; part.CanTouch =false ; part.CanCollide = false end
plr:GetPropretyChangedSignal("Team"):Connect(function()
if team == game.Teams.YOURTEAM then part.Transparency = 0 ; part.CanTouch =false ; part.CanCollide = false end end)
end)
Where should this script be placed?
A server script inside of server script service.
game.Players.PlayerAdded:Connect(function(plr)
local team = plr.Team
if team == game.Teams.Survivors then workspace.Truss.Transparency = 1 ; workspace.Truss.CanTouch =false ; workspace.Truss.CanCollide = false end
plr:GetPropretyChangedSignal("Team"):Connect(function()
if team == game.Teams.Infected then workspace.Truss.Transparency = 0 ; workspace.Truss.CanTouch =true ; workspace.Truss.CanCollide = true end end)
end)
So for Survivors part is gone, but when i’m Infected, i still don’t see it, i’m edited this script right?
If you still have this problem, I would create a RemoteEvent, then add a server script.
After that, I will get the parts I want only wants to see, then I would create a local script and listen for the same RemoteEvent to fire on every client that ISN’T on that team… Every time it fires, the client will remove/ make transparent the part. Client Server Model!
Try to put inside of a LocalScript
, and replace all mentions of plr
with game.Players.LocalPlayer
.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.