Not sure if this is supposed to go in scripting support or game design but I’m trying to find out if it’d be possible to make a system where crime alerts will happen for certain players in the same party, while a different party of players may have to wait a bit longer before getting their crime alert. Players who aren’t in the same party won’t be able to see each other’s enemies or crime alerts. People in the same party will be able to see the same enemies and crime alerts. If I do the entire thing client sided, the enemies won’t sync up for everyone In the party. Any idea on how I can approach this?
1 Like
Make a server script that places parties and their members inside of a table, have both the Server and the Client connect to the same RemoteEvent, and so on.
So just have a RemoteEvent wherever you like inside ReplicatedStorage, preferably with a fancy name like CrimeAlertEvent
, then do something like this:
local Parties = {
["Party1"] = {Alice, Bob, Charlie},
["Party2"] = {Derek, Evelina, Fred},
["Party3"] = {Guillaume, Henri, Isaiah}
}
function SendCrimeAlert(partyToAlert, message, delay) -- add as many parameters as you want here
wait(delay)
for _, player in pairs(Parties[partyToAlert]) do
CrimeAlertEvent:FireClient(player, message)
end
end
SendCrimeAlert("Party1", "this guy is hacking into roblox again you must go shoot him",0)
SendCrimeAlert("Party2", "this party is harassing a guy for no reason",10)
SendCrimeAlert("Party3", "WAAAAAAAAAAR",10)
Then, on the client side, get the RemoteEvent and have it do stuff when the client receives the signal.
CrimeAlertEvent.OnClientEvent:Connect(function(alertMessage)
warn("There is an alert.. deal with it.. " .. alertMessage)
end)
The rest should apply basically the same way I think.
This handles the crime alert side of things, and your response just gave me an idea for handling the enemies. Thanks for your response!