script 1:
01 | local ship = workspace.Ship |
02 | local value = workspace.Value.Value |
03 |
04 | if value = = 'intermission' then |
05 | local new = ship:Clone() |
06 | new.Parent = game.ServerStorage |
07 | value = 'ready' |
08 | end |
09 |
10 | if value = = 'regening' then |
11 | local shipclone = game.ServerStorage.Ship |
12 | local map = shipclone |
13 | map.Parent = workspace |
14 | value = 'intermission' |
15 | end |
script 2:
01 | local ship = script.Parent |
02 | local value = workspace.Value.Value |
03 | local PP = script.Parent.PrimaryPart |
04 | local explosion = workspace.Explosion |
05 | local sinking = workspace [ "Ship Sink 1" ] |
06 | local wave = workspace [ "Ocean wave sound effects [HD]" ] |
07 | workspace [ "Titanic Grand Staircase Ambiance " ] :Play() |
08 | wave:Play() |
09 |
10 | function sink() |
11 | value = 'sinking' |
12 | --private scripting |
13 | end |
14 | value = 'regening' |
15 |
16 | if value = = 'ready' then |
17 | wait( 60 ) |
18 | sink() |
19 | end |
Pls help
You want to use Changed
on problems like this.
Only use Changed
on values like Stringvalue or intvalues
01 | local ship = workspace.Ship |
02 | local value = workspace.Value |
03 |
04 | value.Changed:Connect( function () -- ONLY USE CHANGED FOR STRINGVALUES, OBJECTVALUES, INTVALUES AND NUMBERVALUE, CFRAMEVALUES |
05 | if value.Value = = 'intermission' then |
06 | local new = ship:Clone() |
07 | new.Parent = game.ServerStorage |
08 | value.Value = 'ready' |
09 | elseif value.Value = = 'regening' then |
10 | local shipclone = game.ServerStorage.Ship |
11 | local map = shipclone |
12 | map.Parent = workspace |
13 | value.Value = 'intermission' |
14 | end |
15 |
16 | end ) |
Script 2:
01 | local ship = script.Parent |
02 | local value = workspace.Value.Value |
03 | local PP = script.Parent.PrimaryPart |
04 | local explosion = workspace.Explosion |
05 | local sinking = workspace [ "Ship Sink 1" ] |
06 | local wave = workspace [ "Ocean wave sound effects [HD]" ] |
07 | workspace [ "Titanic Grand Staircase Ambiance " ] :Play() |
08 | wave:Play() |
09 | function sink() |
10 | value = 'sinking' |
11 | --private scripting |
12 | wait( 100 ) -- Change this to how long you think it should sink for |
13 | value.Value = 'regening' |
14 | end |
15 |
If this helped, please mark this as the answer