Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Siren script not working when regened?Your title should be specific! Describe your proble

Hello, I have a script that works when the car is running and not regened, but it doesn't work when the car regenerates. Can somebody help me figure this out?

local ambulance = game.Workspace:WaitForChild("Ambulance")
local shell = ambulance.Shell
local siren = shell["Ambulance Siren"]
script.Parent.ClickDetector.MouseClick:connect(function(player)
	siren:Stop()
end)

1 answer

✓ Accepted answer

You probably haven't made a script to put the script back into the car after regen

put your script:

script.Parent.ClickDetector.MouseClick:connect(function(player)
    local ambulance = game.Workspace:WaitForChild("Ambulance")
workspace.Ambulance.Shell["Ambulance Siren"]:Stop()
end)

into the model that it regenerates from

7 comments

0

But it is supposed to be a button that you click then the siren goes off.

0

ah. I see.

0

use the script i just edited in

0

And I can't put the button inside the ambulance otherwise the whole game will be messed up.

0

use the script i just edited in as it does the script RAW meaning it doesn't take the OLD variables.

0

Thank you for the script, it works now.

0

No problem dude, the thing with regenerating items is that old variables don't get replaced so try to make scripts with regenerating properties RAW, good luck!

This discussion is preserved as it was. New answers, comments, and votes are closed.