Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

can i use 1 remote event to do 2 things?

Asked by
MHaven1 159
5 years ago
Edited 5 years ago

i was wondering if i could use 1 remote event for 2 things so in 1 serverscript it would wait 5 seconds then change the baseplate colour to red and in 2nd it would wait 10 second and then it would change it to black. will that work or will it break or something?

i know i could probably add in a cmnd like

game.Workspace.Event.OnServerEvent:Connect(function(player, Cmnd)
    if Cmnd == "Red" then
    game.Workspace.Baseplate.BrickColor = BrickColor.New("Bright Red")
    elseif Cmnd == "Black" then
    game.Workspace.Baseplate.BrickColor = BrickColor.New("Black")
end)

i dont want to do it that way ^^

1 answer

Log in to vote
1
Answered by 5 years ago

In your case, yes. Instead of doing that, just send the BrickColor you want the baseplate to be like so:

game.Workspace.Event.OnServerEvent:Connect(function(player, colour)
    game.Workspace.Baseplate.BrickColor = colour
end)

Then from a localscript:

game.Workspace.Event:FireServer(BrickColor.new("Really red"))
0
I also suggest you do checks to make sure you are getting correct information. An exploiter could send a Vector3 value and break your script. User#24403 69 — 5y
0
ty MHaven1 159 — 5y
Ad

Answer this question