So I want to make a Fortnite map based on a Roblox game named Escape Tsunami For Brainrots! and im stuck on the script/verse for the Waves/Tsunamis. I have a whole code but there is always 1 Error in it and if i try to fix this 1 Error there comes another one till i think i everything and then the whole script is red, so there is always 1 or more Errors. The first Error of all comes when i have the whole code done and is in the Picture. I would be thankfull if someone could help me! And here is the wohle code:
using { /Fortnite.com/Devices }
using { /Verse.org/Random }
using { /Verse.org/Simulation }
tsunami_speed := enum:
super_slow
slow
medium
fast
super_fast
lightning
wave_data := struct:
Mesh : creative_prop
Damages : []damage_volume_device
Text : billboard_device
Active : logic
TsunamiManager := class(creative_device):
@editable
Waves : []wave_data
@editable
SpawnLocation : vector3
@editable
DespawnX : float = 500.0
SpawnMin : float = 3.0
SpawnMax : float = 30.0
OnBegin<override>()<suspends>:void =
for (W : Waves):
W.Active = false
loop:
SpawnWave()
Sleep(GetRandomFloat(SpawnMin, SpawnMax))
SpawnWave()<suspends>:void =
W := GetFreeWave()
if (!W?):
return
SpeedType := GetRandomSpeed()
SetupWave(W, SpeedType)
MoveWave(W, SpeedType)
GetFreeWave():?wave_data =
for (W : Waves):
if (!W.Active):
W.Active = true
return W
return false
SetupWave(W:wave_data, Speed:tsunami_speed):void =
Text : string
Color : linear_color
Scale : vector3
match(Speed):
tsunami_speed.super_slow =>
Text := "SUPER SLOW"
Color := linear_color{B:=1.0}
Scale := vector3{2.0,1.0,1.0}
tsunami_speed.slow =>
Text := "SLOW"
Color := linear_color{B:=1.0}
Scale := vector3{2.0,1.0,1.0}
tsunami_speed.medium =>
Text := "MEDIUM"
Color := linear_color{G:=1.0}
Scale := vector3{3.0,1.5,1.5}
tsunami_speed.fast =>
Text := "FAST"
Color := linear_color{R:=1.0}
Scale := vector3{4.0,2.0,2.0}
tsunami_speed.super_fast =>
Text := "SUPER FAST"
Color := linear_color{R:=1.0}
Scale := vector3{4.0,2.0,2.0}
tsunami_speed.lightning =>
Text := "LIGHTNING"
Color := linear_color{R:=0.5,B:=0.5}
Scale := vector3{6.0,3.0,3.0}
W.Mesh.SetTransform(transform{
Translation := SpawnLocation,
Scale := Scale
})
W.Text.SetText(Text)
W.Text.SetTextColor(Color)
W.Text.SetTransform(transform{
Translation := SpawnLocation + vector3{Z:=300.0}
})
for (D : W.Damages):
D.SetTransform(transform{Translation := SpawnLocation})
MoveWave(W:wave_data, SpeedType:tsunami_speed)<suspends>:void =
Speed :=
match(SpeedType):
tsunami_speed.super_slow => 200.0
tsunami_speed.slow => 400.0
tsunami_speed.medium => 600.0
tsunami_speed.fast => 900.0
tsunami_speed.super_fast => 1200.0
_ => 1600.0
loop:
Pos := W.Mesh.GetTransform().Translation
NewX := Pos.X - Speed * GetDeltaTime()
NewPos := vector3{X:=NewX,Y:=Pos.Y,Z:=Pos.Z}
W.Mesh.MoveTo(NewPos, rotation{}, 0.0)
W.Text.MoveTo(NewPos + vector3{Z:=300.0}, rotation{}, 0.0)
for (D : W.Damages):
D.MoveTo(NewPos, rotation{}, 0.0)
if (NewX <= DespawnX):
W.Active = false
break
Sleep(0.0)
GetRandomSpeed():tsunami_speed =
match(GetRandomInt(0,5)):
0 => tsunami_speed.super_slow
1 => tsunami_speed.slow
2 => tsunami_speed.medium
3 => tsunami_speed.fast
4 => tsunami_speed.super_fast
_ => tsunami_speed.lightning

