#remote event help

1 messages · Page 1 of 1 (latest)

turbid pecan
#

i need help with this

#

remote event help

#

basically, i have a serverscript which im trying to use

event:FireAllClients("« Phase X »", "Subtitle Text")

to fire

#

this is the script

#
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

repeat task.wait() until game.Loaded
local event = ReplicatedStorage:WaitForChild("PhaseSystem"):WaitForChild("PhaseCutscene")

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local gui = player:WaitForChild("PlayerGui"):WaitForChild("PhaseCutsceneGui")
local mainFrame = gui:WaitForChild("MainFrame")
local title = mainFrame:WaitForChild("PhaseTitle")
local subtitle = mainFrame:WaitForChild("PhaseSubtitle")
local circle = mainFrame:WaitForChild("CircleBurst")

local typingSpeed = 0.05 -- seconds per letter
print("[int] variables set")
-- Function to play typing animation
local function typeText(fullText)
    print("function called")
    subtitle.Text = ""
    print("text cleared")
    for i = 1, #fullText do
        subtitle.Text = string.sub(fullText, 1, i)
        print("i think this types")
        task.wait(typingSpeed)
    end
end

-- Function to play circle animation
local function playCircle()
    circle.Visible = true
    circle.ImageTransparency = 0
    circle.Size = UDim2.fromScale(0, 0)
    print("circle image set")

    -- expand
    circle:TweenSize(UDim2.fromScale(2, 2), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 1, true)
    print("expanding")

    -- fade
    TweenService:Create(circle, TweenInfo.new(1.5), {ImageTransparency = 1}):Play()
    print("fading")
end

-- Listen for phase cutscene event
event.OnClientEvent:Connect(function(phaseTitle, phaseSubtitle)
    print("signal recieved [cutscene handler]")
    gui.Enabled = true
    print("gui enabled")

    -- set title text immediately
    title.Text = phaseTitle
    print("title text set")

    -- play burst
    playCircle()
    print("burst ran")

    -- play typing subtitle
    typeText(phaseSubtitle)
    print("subtitling")

    task.wait(3) -- keep on screen a bit
    gui.Enabled = false
    print("gui disabled")
end)
lapis siren
#

ai..

#

make sure this stuff actually exists local event = ReplicatedStorage:WaitForChild("PhaseSystem"):WaitForChild("PhaseCutscene") i.e check output window for infinite yield warnings

turbid pecan
#

even ai co uldnt help

#

so i went here-