Hello! I Have made like 50 thousand posts about my games bossfight / survival section area cuz there are too many bugs in it.
I just fixed the attacks in the bossfight and it works perfectly fine in singleplayer, but in multiplayer its complete chaos.
[Btw the bossfight happens right after a cutscene]
I Have no idea what is happening, but if anyone can help i will be really happy, cuz i really want to finish the game today cuz its like 90% done.
heres the script that fires the cutscene [Script inside a part]:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
game.ReplicatedStorage.FixedHospitalCutscene:FireAllClients()
script.Enabled = false
end
end)
and heres the thing it is triggering in the massive cutscene handler [Local Script in StarterGui]:
game.ReplicatedStorage.FixedHospitalCutscene.OnClientEvent:Connect(function()
Player.PlayerGui.Main.MobileButtons.SprintButton.Visible = false
Player.PlayerGui.Main.Stamina.Background.Bar.Sprint.Enabled = false
Humanoid.WalkSpeed = 0
HumanoidRootPart.CFrame = workspace:WaitForChild("CutsceneSpawn").CFrame
Camera.CameraType = Enum.CameraType.Scriptable
TweenService:Create(Camera, TweenInfo.new(1, Enum.EasingStyle.Linear,Enum.EasingDirection.InOut, 0), {CFrame = workspace.Cam1.CFrame}):Play()
HandWindow:Stop()
HandDown:Play()
Player.PlayerGui.Main.Stamina.Background.Visible = false
Player.PlayerGui.Main.Dialogue.DialogueFrame.Visible = true
script.TenebrisVoicelines2.L1C:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "this place was swarming with many children. Every child loved their friend Goaty, but he especialy loved one child..."
script.TenebrisVoicelines2.L1C.Ended:Wait()
script.TenebrisVoicelines2.GWS:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "Alex was the one he loved. They both really liked to draw and they were best friends. Sadly Alex was sick with cancer and when the doctor told him that Goaty was sad..."
script.TenebrisVoicelines2.GWS.Ended:Wait()
script.TenebrisVoicelines2.GLD:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "other kids noticed Goaty started to look different after the death of Alex. They said that sometimes it felt like they were being watched..."
script.TenebrisVoicelines2.GLD.Ended:Wait()
script.TenebrisVoicelines2.TGAAG:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "not too long after many weird stuff happened, the hospital was closed and abandoned. Although no one was supposed to go there, some people still went there and some captured camera footage of the Goat and a ghost..."
script.TenebrisVoicelines2.TGAAG.Ended:Wait()
script.TenebrisVoicelines2.S1983:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "since 1983 the hospital was alright and after the death of Alex, everything changed to this day"
script.TenebrisVoicelines2.S1983.Ended:Wait()
Player.PlayerGui.Main.Dialogue.DialogueFrame.Visible = false
wait(3)
Player.PlayerGui.Main.Dialogue.DialogueFrame.Visible = true
script.TenebrisVoicelines2.YNSTBH:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "Your not supposed to be here..."
script.TenebrisVoicelines2.YNSTBH.Ended:Wait()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "What?"
wait(1.5)
script.TenebrisVoicelines2.YSTDIE:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "Your supposed to die.."
script.TenebrisVoicelines2.YSTDIE.Ended:Wait()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "WHAT?!"
wait(1.5)
script.TenebrisVoicelines2.ISYST:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "I SAID YOUR SUPPOSED TO"
script.TenebrisVoicelines2.ISYST.Ended:Wait()
script.TenebrisVoicelines2.DIE:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "DIE!"
HandDown:Stop()
DieAnim:Play()
wait(1)
workspace.Ambience2:Stop()
workspace.BeyondAmbience1:Stop()
workspace.BeyondAmbience2:Stop()
Player.PlayerGui.Main.Dialogue.DialogueFrame.Visible = false
Player.PlayerGui.Main.Fade.BackgroundTransparency = 0
wait(2)
game.ReplicatedStorage.TriggerBossFightVisibility:FireServer()
HumanoidRootPart.CFrame = workspace.HeartRespawnPoint.CFrame
Camera.CameraType = Enum.CameraType.Custom
game.Lighting.Ambient = Color3.fromRGB(100,100,100)
game.Lighting.Brightness = 3
game.Lighting.ClockTime = 12
game.Lighting.FogEnd = 250
FadeTween2:Play()
wait(2.5)
Player.PlayerGui.Main.Fade.BackgroundTransparency = 1
Player.PlayerGui.Main.Dialogue.DialogueFrame.Visible = true
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "Huh!? How did i get here?!"
wait(3)
workspace.BeyondAmbience1:Play()
workspace.BeyondAmbience2:Play()
script.TenebrisVoicelines2.TTDH:Play()
Player.PlayerGui.Main.Dialogue.DialogueFrame.DialogueText.Text = "TIME TO DIE HUMAN :)"
script.TenebrisVoicelines2.TTDH.Ended:Wait()
game.ReplicatedStorage.StartBossFight:FireServer()
Player.PlayerGui.Main.Dialogue.DialogueFrame.Visible = false
if Uis.TouchEnabled then
Player.PlayerGui.Main.MobileButtons.SprintButton.Visible = true
end
Player.PlayerGui.Main.Stamina.Background.Bar.Size = UDim2.new(1,0,1,0)
Player.PlayerGui.Main.Stamina.Background.Bar.Position = UDim2.new(-0.001, 0,-0, 0)
Player.PlayerGui.Main.Stamina.Background.Visible = true
Player.PlayerGui.Main.Dialogue.DialogueFrame.Visible = false
Humanoid.WalkSpeed = 8
Humanoid.JumpPower = 50
Player.PlayerGui.Main.Stamina.Background.Bar.Sprint.Enabled = true
workspace.Objective:Play()
Character:WaitForChild("CanClick").Value = false
Player.PlayerGui.Main.Lives.Heart1.Visible = true
Player.PlayerGui.Main.Lives.Heart2.Visible = true
Player.PlayerGui.Main.Lives.Heart3.Visible = true
Player.PlayerGui.Main.Lives.Heart4.Visible = true
Player.PlayerGui.Main.Lives.Heart5.Visible = true
ObjectiveTween1:Play()
ObjectiveTweenText1:Play()
ObjectiveTweenText2:Play()
Player.PlayerGui.Main.Objective.ObjectiveFrame.ObjectiveText.Text = "SURVIVE [YOU HAVE 6 LIVES AND YOU CAN JUMP]"
wait(3)
ObjectiveTween2:Play()
ObjectiveTweenText3:Play()
ObjectiveTweenText4:Play()
ObjectiveTween2.Completed:Wait()
Character:WaitForChild("CanClick").Value = true
end)
and now here is the bossfight handler [Script in serverscriptservice]:
local rotation = CFrame.Angles(0, math.rad(135), 0)
local rotation2 = CFrame.Angles(0, math.rad(-135), 0)
local RotTentacle = CFrame.Angles(0, math.rad(180), 0)
local CanAttack = true
game.Players.PlayerAdded:Connect(function(plr)
local function selectPlayer()
local players = game.Players:GetPlayers()
local selected = players[math.random(1,#players)]
return selected
end
local function TearDropAttack()
local TearDropModel = game.ReplicatedStorage.BossFightAttacks.TearDropAttack:Clone()
workspace.BossFightAudio.Alert:Play()
CanAttack = false
TearDropModel.Parent = workspace
wait(1.8)
TearDropModel:WaitForChild("AlertParts"):Destroy()
workspace.BossFightAudio.WaterDrop:Play()
game:GetService("TweenService"):Create(TearDropModel.PrimaryPartBase, TweenInfo.new(3), {CFrame = workspace.TearDropFallenCFrame.CFrame}):Play()
wait(1)
workspace.BossFightAudio.WaterDrop:Stop()
TearDropModel:Destroy()
CanAttack = true
end
local function BallAttack(PlayerSelected)
local Ball = game.ReplicatedStorage.BossFightAttacks.SlimeBallAttack:Clone()
CanAttack = false
Ball.Parent = workspace
workspace.BossFightAudio.SlimeBallAttack:Play()
game:GetService("TweenService"):Create(Ball, TweenInfo.new(1.5), {CFrame = PlayerSelected.Character.HumanoidRootPart.CFrame * CFrame.new(15,0,0)}):Play()
wait(0.5)
CanAttack = true
Ball:Destroy()
end
local function TentacleSmackAttack(PlayerSelected)
print("Smack Started")
local Tentacle = game.ReplicatedStorage.BossFightAttacks.TentacleSlam:Clone()
game:GetService('RunService').Stepped:Wait()
CanAttack = false
Tentacle.Parent = workspace
Tentacle.PrimaryPart.CFrame = CFrame.lookAt(Tentacle.PrimaryPart.Position, PlayerSelected.Character.PrimaryPart.Position) * CFrame.Angles(math.rad(-82.251), 0, math.rad(90))
wait(0.5)
local Anim = Tentacle.Humanoid.Animator:LoadAnimation(script.SlamAnim)
wait(0.5)
workspace.BossFightAudio.TentacleAppear:Play()
Anim:Play()
Anim.Ended:Wait()
print("Attack Finished")
wait(1)
CanAttack = true
Tentacle:Destroy()
end
local function TentacleSpinAttack()
local Tentacle = game.ReplicatedStorage.BossFightAttacks.TentacleSpin:Clone()
--local Tentacle2 = game.ReplicatedStorage.BossFightAttacks.TentacleSpin2:Clone()
game:GetService('RunService').Stepped:Wait()
CanAttack = false
Tentacle.Parent = workspace
--Tentacle2.Parent = workspace
wait(0.5)
local Anim = Tentacle.Humanoid.Animator:LoadAnimation(script.SpinAnim)
-- local Anim2 = Tentacle2.Humanoid.Animator:LoadAnimation(script.SpinAnim)
wait(0.5)
workspace.BossFightAudio.TentacleAppear:Play()
Anim:Play()
--Anim2:Play()
Anim.Ended:Wait()
print("Attack Finished")
wait(1)
CanAttack = true
Tentacle:Destroy()
--Tentacle2:Destroy()
end
game.ReplicatedStorage.StartBossFight.OnServerEvent:Connect(function()
workspace.BossFightAudio.BossFightMusicV2:Play()
local RandomPlayer = nil
TearDropAttack()
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
BallAttack(RandomPlayer)
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
BallAttack(RandomPlayer)
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
TentacleSmackAttack(RandomPlayer)
TearDropAttack()
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
BallAttack(RandomPlayer)
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
TentacleSmackAttack(RandomPlayer)
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
TentacleSpinAttack()
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
TentacleSmackAttack(RandomPlayer)
TearDropAttack()
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
TentacleSpinAttack()
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
TentacleSmackAttack(RandomPlayer)
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
TentacleSmackAttack(RandomPlayer)
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
TentacleSmackAttack(RandomPlayer)
TearDropAttack()
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
BallAttack(RandomPlayer)
RandomPlayer = selectPlayer()
workspace.BossfightTenebris.Cube.CFrame = CFrame.lookAt(workspace.BossfightTenebris.Cube.Position, RandomPlayer.Character.HumanoidRootPart.Position)
TentacleSpinAttack()
print("Ended")
workspace.BossFightAudio.BossFightMusicV2:Stop()
end)
end)
script.SlamAnim:GetMarkerReachedSignal("SmackSound"):Connect(function(value)
workspace.BossFightAudio.TentacleSmack:Play()
end)
script.SpinAnim:GetMarkerReachedSignal("SmackSound"):Connect(function(value)
workspace.BossFightAudio.TentacleSmack:Play()
end)
[note : some stuff in the bossfight handler are not really used]
i have no idea what to do since this is the first time this had happened to me. [probably cuz this is my first multiplayer game]