this is probably really simple but I need to fire a remote event to only the players on a team.
I couldnt find anything online abt it online, this was my attempt on trying it:
screenshake:FireClient(game.Teams.Playing:GetPlayers())
this is probably really simple but I need to fire a remote event to only the players on a team.
I couldnt find anything online abt it online, this was my attempt on trying it:
screenshake:FireClient(game.Teams.Playing:GetPlayers())
U could add a table of players (the group) in the second parameter in the fire client and then
screenshake.OnClientevent:connect(function(plrGroup)
if plrGroup[game.players.localplayer.name] then
--effect
end
end)
Thanks! it worked
30 asoidf chars
I recommend marking @ZINTICK 's answer as solution so that other people can see that this post was answered as well!
I wouldn’t recommend this approach since the ‘RemoteEvent’ object ends up performing work it can otherwise avoid.
Also OnClientevent
should be OnClientEvent
.
local Game = game
local Teams = Game:GetService("Teams")
local RedTeam = Teams.RedTeam
for _, RedPlayer in ipairs(RedTeam:GetPlayers()) do
RemoteEvent:FireClient(RedPlayer)
end
yes I suppose that is one way you could do it
I knew this it was just example code