Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I can't get the timer to appear after my loading screen, what am I doing wrong? (events)

Asked by 4 years ago

Hello, I am trying to make GUI of the clock show up once the custom GUI loading screen disappears but the clock fails to show up once the loading screen is gone, what am I doing wrong?

CLOCK SCRIPT

local replicatedStorage = game:GetService("ReplicatedStorage")

local event = replicatedStorage:FindFirstChild("ChangeTime")

local LScheck = replicatedStorage:FindFirstChild("loadingscreendone")

local frame = script.Parent.Parent


frame.Visible = false


LScheck.Event:connect(

    function(check)

        if(check == true)

        then

            frame.Visible = true

        else

            frame.Visible = false

        end

    end
) 

event.OnClientEvent:connect(

    function(text)

    script.Parent.Text = text

    end
)

LOADING SCREEN SCRIPT


game.ReplicatedFirst:RemoveDefaultLoadingScreen() local ReplicatedStorage = game:GetService("ReplicatedStorage") local LScheck = ReplicatedStorage:FindFirstChild("loadingscreendone") local check = true local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui") PlayerGui:SetTopbarTransparency(0) local GUI = script.LoadingScreen:Clone() GUI.Parent = PlayerGui repeat wait(.1) until game:IsLoaded() wait(math.random(4,6)) GUI.Frame:TweenPosition(UDim2.new(0,0,1,0), "InOut", "Sine", 0.5) wait(0.5) LScheck:Fire(check) GUI:Destroy()

https://i.imgur.com/bOBHIC4.png

1 answer

Log in to vote
0
Answered by 4 years ago

Hay, great question I think I can help.

Sometimes you may be doing everything correctly theoretically, but actually you might be missing it on implementation.

I see you use remote event for clock to appear when Loading Screen loading ends and that's great, but this line is where it's wrong:

LScheck:Fire(check)

Because you're using remote event it is not going to work, because Remote events can't be used to communicate between local scripts. In fact there is no Remote or Bindable event that can be used for that.

You can be using Fire Servcer and on the server firing client, but that's not best solution. Instead, I would create bool value inside client and make it true when Loading ends which would trigger ChangedProperty Event on that bool value.

0
Would you mind telling me how to do it your way coding wise? Sorry I'm new to this cyanslime123 23 — 4y
Ad

Answer this question