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

How do you make it so filtering enabled changes the properties of a part?

Asked by 6 years ago

I have been trying to change the can collide and transparency of a part, while also changing the audio. It works perfectly in Roblox studio but in the game, it doesn't.

local debounce = false

game.Workspace.LazerDisable.DisableLazerEvent.OnServerEvent:Connect(function()

wait(0.1)

if not debounce then

debounce = true

game.Workspace.Lockdown.CanCollide = true
game.Workspace.Lockdown.Transparency = 0.9
wait(0.25)
game.Workspace.Lockdown.Transparency = 0.8
wait(0.25)
game.Workspace.Lockdown.Transparency = 0.7
wait(0.25)
game.Workspace.Lockdown.Transparency = 0.6
wait(0.25)
game.Workspace.Lockdown.Transparency = 0.5
wait(0.25)
game.Workspace.Lockdown.Transparency = 0.4
wait(0.25)
game.Workspace.Lockdown.Transparency = 0.3
wait(0.25)
game.Workspace.Lockdown.Transparency = 0.2
wait(0.25)
game.Workspace.Lockdown.Transparency = 0.1
wait(0.25)
game.Workspace.Lockdown.Transparency = 0

game.Workspace.Song.Volume = 0

local s = Instance.new("Sound")

-- alarm sound

s.Name = "alarmSound"
s.SoundId = "http://www.roblox.com/asset/?id=293499018" -- Type your music ID here
s.Volume = 1
s.Pitch = 1
s.Looped = true
s.archivable = false

s.Parent = game.Workspace

wait(0)

s:play()

-- lockdown sound

local s = Instance.new("Sound")

s.Name = "lockdownSound"
s.SoundId = "http://www.roblox.com/asset/?id=1836476447" -- Type your music ID here
s.Volume = 1
s.Pitch = 1
s.Looped = false
s.archivable = false

s.Parent = game.Workspace

wait(15)

s:play()

wait(15)

s:play()

wait(15)

s:play()

wait(15)

debounce = false

end

end)
0
why use events while you can just put a normal script and put it in workspace or server script service? CjayPlyz 643 — 6y
0
because I need it to show for everyone on the server not just 1 person MMCraftin 8 — 6y
0
and because it is activated by a click detector MMCraftin 8 — 6y
0
Thats a reason for it Sergiomontani10 236 — 6y

Answer this question