Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 1 month ago

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

Log in to vote
2
Answered by
VAHMPIN 265 Moderation Voter
1 month ago
Edited 1 month ago

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

0
But it is supposed to be a button that you click then the siren goes off. squidiskool 108 — 1mo
0
ah. I see. VAHMPIN 265 — 1mo
0
use the script i just edited in VAHMPIN 265 — 1mo
0
And I can't put the button inside the ambulance otherwise the whole game will be messed up. squidiskool 108 — 1mo
View all comments (3 more)
0
use the script i just edited in as it does the script RAW meaning it doesn't take the OLD variables. VAHMPIN 265 — 1mo
0
Thank you for the script, it works now. squidiskool 108 — 1mo
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! VAHMPIN 265 — 1mo
Ad

Answer this question