#script help

46 messages · Page 1 of 1 (latest)

wispy narwhal
#

-- Assume that ReplicatedFirst is a service
local ReplicatedFirst = game:GetService("ReplicatedFirst")

-- Assume that LoadingScreenScript is a script
local LoadingScreenScript = ReplicatedFirst.LoadingScreenScript

-- Assume that LoadingScreen is a ScreenGui
local LoadingScreen = LoadingScreenScript.LoadingScreen

-- Assume that BackGround is a frame within the ScreenGui
local BackGround = LoadingScreen.BackGround

-- Assume that SkipButton is a TextButton within the BackGround frame
local SkipButton = BackGround.Skip

-- Function to be executed when the TextButton is clicked
local function OnSkipButtonClick()
-- Set the visibility of the background frame to false
BackGround.Visible = false
end

-- Connect the function to the TextButton's Click event
SkipButton.MouseButton1Click:Connect(OnSkipButtonClick)

#

I am trying to make skip button for my loading scsreen

#

but it doesnt work

jagged matrix
#

Not local.

wispy narwhal
#

Local script is LoadingScreens script

jagged matrix
#

Ok but skip wont work also

#

When script will moved to playerGUI this script will be not avaible to see it anymore in RF

wispy narwhal
#

How can I fix it?

jagged matrix
#

Not sure

wispy narwhal
jagged matrix
#

You put this local script in player GUI..?

#

Wait

#

Nvm

wispy narwhal
#

script and gui is in ReplicatedFirst

jagged matrix
#

I just speaking with 3 guy rn

#

And i missed up a bit

#

Ok so

#

You need put that script inside of GUI

#

Since it wont work either

strange reef
# wispy narwhal

this won't work. Also, why aren't you just doing it the simple way?

#

you have a script that manages the loading. All you need to add is a single function to that script for when the skip button is pressed

#

Skip -> destroy the UI (or hide it, depending on your other scripts)

wispy narwhal
strange reef
#

Show me the script that handles the loadingscreen

strange reef
#

oh that's easy

clonedLoadingScreen.Background.skip.MousButton1Click:Connect(function()
  clonedLoadingScreen:Destroy
end) ```
#

Should work like a charm

wispy narwhal
strange reef
strange reef
#

oh wait

#

did you just copy what I send?

#

if so then just check for any red lines under the words. I may have messed up a capital somewhere

strange reef
#

oh right

#

I forgot to add the ()

#

change that line to

clonedLoadingScreen:Destroy()
wispy narwhal
#

no error