How to use Remote Events On Roblox | FilteringEnabled | Roblox Studio

Опубликовано: 29 Октябрь 2024
на канале: Frepzter
229
8

Hey fellow coders! In todays video I'll be showing you guys how to use remote events. This is extremely useful for most games since roblox Forces FilteringEnabled. It works by a Client firing and sending data to a server. I can cover Server to client in another video!

ClientSided Script:
script.Parent.MouseButton1Click:Connect(function()
local ColorValue = BrickColor.Random()

game.ReplicatedStorage.ChangeColor:FireServer(ColorValue)
end)

serversided script:
game.ReplicatedStorage.ChangeColor.OnServerEvent:Connect(function(plr, ColorValue)
workspace.Baseplate.BrickColor = ColorValue
local plrname = plr.Name
print(plrname.." has just fired a remote event and changed the baseplate color to "..tostring(ColorValue))

end)

remember to make a remoteEvent in ReplicatedStorage :D