Highway Variable Message Sign (VMS) / Matrix Board Scripting

Hello Developers! :wave:

I’ve been working on a roleplay game, and I’ve stumbled upon a unique issue I do not know how to work on.

I’d like to create a Variable Message Board (VBS/VMS) for my highways, which should only be accessible by a specific team I made previously. I understand that creating a completely custom message board system with free text is extremely risky, so I am going after preset icons/messages, to avoid such issues.

Example:

I am not really good at scripting, but I do have a basic idea of algorithms, and I have a basic one in mind.

That’s pretty much what I have so far. I tried to look through the web for answers, even tried AI which I hate doing, but couldn’t land no where useful, so I am seeking the help of the devforum!

Any assistance is very appreciated! :heart_hands:

2 Likes

You can detect when the player has interacted with the control box with .MouseButton1Click event of a TextButton.
Then, on the client, you can check if the player is in the specified team by comparing the player’s .Team property to the team that you want to compare with.

For example:

local Teams = game:GetService("Teams")
if player.Team == Teams.teamName... -- Enter the team name, and continue

If the player is a member of the specified team, you can open the options GUI using the .Visible property of a Frame. (or .Enabled of a ScreenGui)

When the player selects the icon, using RemoteEvents, you can do some checks on the server to make sure the player is actually in the correct team, then display the selection that comes with the data sent from the client.

Here are the documentation pages to help you out:

1 Like

This is pretty simple. You can do the following to make this happen:

Server Script in control box:

local box = script.Parent
local TS = game:GetService("TeamService")
local proximity = box:WaitForChild("Proximity")

proximity.Triggered:Connect(function(player)
  if player then
    if player.Team == TS.yourteamhere then
    player.PlayerGui:WaitForChild("youreditguihere").Enabled = true
    end
  end
end)

1 Like

Thanks for providing so many good resources! I’ll make sure to go over them and try and come up with something. Means a lot! :heart_hands:

1 Like

This is very helpful for the Control Box, and I’ll make sure to try it out ASAP. I’ll also try and a dig up a bit more for the decal changing on the actual sign using the UI element. Thank you very much!

1 Like

I can write some code for that too if you want. :smiley:

That’d be nice of you! Thanks :smile:

All right. What I am going to do is put the different image IDs into a table you can pull from. I am pretty sure this will work, if it doesn’t just get back to me with the errors. This would go in a local script in your GUI. Then you would have to write a server script connected with a remote event to change it on the actual sign.

local image = script.Parent:WaitForChild("Image")

local images = {
	"123241431",
	"165123123",
	"568354342"
}

local arrowButton = script.Parent:WaitForChild("arrowButton")
local stopButton = script.Parent:WaitForChild("stopButton")
local yieldButton = script.Parent:WaitForChild("yieldButton")

local function changeIcon(ID)
	image.Image = ID
end

arrowButton.MouseButton1Clicked:Connect(changeIcon(images[1]))
stopButton.MouseButton1Clicked:Connect(changeIcon(images[2]))
yieldButton.MouseButton1Clicked:Connect(changeIcon(images[3]))