function hello(mode) if mode == "Retract" then game.Workspace.RoadBlock.PopOne.Transparency = 1 game.Workspace.RoadBlock.PopTwo.Transparency = 1 game.Workspace.RoadBlock.PopThree.Transparency = 1 game.Workspace.RoadBlock.PopFour.Transparency = 1 game.Workspace.RoadBlock.PopFive.Transparency = 1 game.Workspace.RoadBlock.PopSix.Transparency = 1 game.Workspace.RoadBlock.PopOne.CanCollide = false game.Workspace.RoadBlock.PopTwo.CanCollide = false game.Workspace.RoadBlock.PopThree.CanCollide = false game.Workspace.RoadBlock.PopFour.CanCollide = false game.Workspace.RoadBlock.PopFive.CanCollide = false game.Workspace.RoadBlock.PopSix.CanCollide = false elseif mode == "Deploy" then game.Workspace.RoadBlock.PopOne.Transparency = 0 game.Workspace.RoadBlock.PopTwo.Transparency = 0 game.Workspace.RoadBlock.PopThree.Transparency = 0 game.Workspace.RoadBlock.PopFour.Transparency = 0 game.Workspace.RoadBlock.PopFive.Transparency = 0 game.Workspace.RoadBlock.PopSix.Transparency = 0 game.Workspace.RoadBlock.PopOne.CanCollide = true game.Workspace.RoadBlock.PopTwo.CanCollide = true game.Workspace.RoadBlock.PopThree.CanCollide = true game.Workspace.RoadBlock.PopFour.CanCollide = true game.Workspace.RoadBlock.PopFive.CanCollide = true game.Workspace.RoadBlock.PopSix.CanCollide = true end end game.ReplicatedStorage.Bollards.OnServerEvent:connect(hello)
Tried lots of things, and it didn't work. All of the 'pops' are unions of bollards. Script is in ServerScriptService, remoteevent named Bollards is in replicatedstorage.
Tried firing it.
game.ReplicatedStorage.Bollards:FireServer("Deploy") game.ReplicatedStorage.Bollards:FireServer("Retract")
Both won't work. Any ideas?
game.ReplicatedStorage.Bollards.OnServerEvent:Connect(function(player, mode) -- first argument on `OnServerEvent`'s are always the player that fired the server for k, v in ipairs(workspace.RoadBlock:GetChildren()) do -- shorten your script by using a for loop instead if mode == "Retract" then v.Transparency = 1 v.CanCollide = false elseif mode == "Deploy" then v.Transparency = 0 v.CanCollide = true end end end