Hi, first of all i am very sorry if this question is dumb or smth but i'm very new to coding in roblox.
So i made this script (and i made 4 of these for every light) so when i press E on the keyboard the police lights on this car flash for few seconds and then stop but when i wanted to show it to my friends i saw that when i clicked the ubtton it showed it flashing only to me so it just shows up only to the player that clicks the key and i dont know how to make it so it will show to every player.
I think the issue is because this script is in a LocalScript not normal Script but when i paste it in to a normal script it doesnt work pelase help.
Also the scripts are located in StartedGui
script for the two big light in the big lightbar:
local goodpart = game.Workspace.transporterT4.Body.biglightbar.unionright
local key = game:GetService("UserInputService")
key.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
goodpart.BrickColor = BrickColor.new("Medium blue")
goodpart.Material = Enum.Material.SmoothPlastic
wait(0.15)
goodpart.Material = Enum.Material.Neon
wait(0.15)
goodpart.Material = Enum.Material.SmoothPlastic
wait(0.15)
goodpart.Material = Enum.Material.Neon
wait(0.15)
goodpart.Material = Enum.Material.SmoothPlastic
wait(0.15)
goodpart.Material = Enum.Material.Neon
wait(0.15)
goodpart.Material = Enum.Material.SmoothPlastic
end
end)
script for the 2 small lightbars on the back of the car:
local goodpart = game.Workspace.transporterT4.Body.leftlightbar.main
local key = game:GetService("UserInputService")
key.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
goodpart.BrickColor = BrickColor.new("Medium blue")
goodpart.Material = Enum.Material.Neon
wait(0.15)
goodpart.Transparency = 0
wait(0.15)
goodpart.Transparency = 1
wait(0.15)
goodpart.Transparency = 0
wait(0.15)
goodpart.Transparency = 1
wait(0.15)
goodpart.Transparency = 0
wait(0.15)
goodpart.Transparency = 1
wait(0.15)
goodpart.Transparency = 0
end
end)

1 comment
yeah like he said