#bug (case closed i fixed it)

1 messages · Page 1 of 1 (latest)

fossil tinsel
#

the following code does not work, 1 client sees the intro while the other sees just nothing until the other disconnects
i tried to ask assistant for help but they didnt fix it

code:

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local cam = workspace.CurrentCamera
local isPlayingIntro = false

local function playIntro(next_killer)
    if isPlayingIntro then return end
    isPlayingIntro = true
    
    cam.CameraType = Enum.CameraType.Scriptable
    if next_killer == "c00lkidd" then
        cam.CFrame = workspace["c00lkidd intro"].cam.CFrame
        local track = workspace["c00lkidd intro"].c00lkidd.c00loid.Animator:LoadAnimation(workspace["c00lkidd intro"].c00lkidd.anim)
        track:Play()
        
        local hitMarkerReached = false
        track:GetMarkerReachedSignal("hit"):Connect(function()  
            if hitMarkerReached then return end
            hitMarkerReached = true
            game.SoundService["c00lkidd hit"]:Play()
        end)
        
        track.Ended:Connect(function()  
            cam.CameraType = Enum.CameraType.Custom
            isPlayingIntro = false
        end)
    else
        -- If it's not c00lkidd, immediately restore camera
        cam.CameraType = Enum.CameraType.Custom
        isPlayingIntro = false
    end
end

-- Connect to the remote event
game.ReplicatedStorage["killer intro"].OnClientEvent:Connect(playIntro)
vapid wraith
#

wherever you're firing game.ReplicatedStorage["killer intro"] needs to be fireallclients
game.ReplicatedStorage["killer intro"]:fireallclients()

#

@fossil tinsel

fossil tinsel
#

i used fire all clients

vapid wraith
#

Where is this script located

fossil tinsel
#

its managed by the client so its in starter player > starter player scripts

fossil tinsel
#

alr i fixed it myself case closed