Police Alert System

I want to make so when player activates the prompt, everyone who is on the Police team will get UI from starter gui that will open for 5 seconds then dissapier.

1 Like

Here, you are not asking for our help. You are trying to hire someone to do the whole thing. If you want to hire a developer, please visit the talent hub.

Otherwise, we can help you if you provide more infos and, mainly, something for us to help you with (like a piece of code you tried to make and which is not working).

It’s just a piece of code in my robbery system, I tried some of the scripts but they wont work.

I guess you could do this:

--looping through all the players
for i,v in ipairs(team:GetPlayers()) do
    player.PlayerGui.ScreenGui.Enabled = true
end
wait(5)
for i,v in ipairs(team:GetPlayers()) do
    player.PlayerGui.ScreenGui.Enabled = false
end
1 Like

You should prefer managing UIs on the client side, just fire a remote event to the clients and handle the UI there.

2 Likes

Absolutely. Good code just needs to be done in the right place. I explained CFrame’s to someone recently and they finally agreed to do them on the client side. Doing things in their proper place is a huge help to overall game performance and tends to fix bugs too. I think Roblox gets hyper sometimes with ‘deprecating’ things. They should focus more on teaching people and improving documentation instead of worrying about what to deprecate next

1 Like

I think it is more complicated than that.

First, each case is different, for example, not all the CFrames need to be managed on the client side. What we should manage on the client side is CFrames manipulations for dynamic objects. If an object is *semi-*static, it is often better to handle it on the server. It’s more specific than that. The same thing occurs with UIs, some kind of UIs must be managed on the server too.

Regarding education, roblox made a lot of improvements regarding the subject these last months, even if there is still a long path ahead…
Also, deprecating features normally help building a better API, which should help developpers.

Anyway this is a subject which need to have his own post in dev discussions I guess.

2 Likes

Before making a scripting support post, actually read the things you should do before you make a new post. You did not follow the requirements set, but here:

Use Remotes and FireAllClients?
then enable the notifications on the client side or create them?

Server Trigger

local prompt = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage.RemoteEvent


prompt.Triggered:Connect(function(player)
	local data = {}
	event:FireAllClients(data)
end)

Client Trigger

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage:WaitForChild("RemoteEvent")

event.OnClientEvent:Connect(function(data)
	print(data)
end)

Then you can use this on ui modifications.

1 Like