Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make my intro not show up after you reset or die?

So I edited this intro, and I cant make it work with when you reset or die the intro doesnt show up anymore. I just want it to show up when you start the game, and thats it only once. Thanks!

First I placed this on a script inside startergui

local legui = script.Intro:Clone()
game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:wait()
	legui:Clone().Parent = player.PlayerGui
end)

Then I placed a gui inside the script and made a local script

local Screen = script.Parent
local Config = Screen.Config
local Filter = Screen.Filter
local Content = Screen.Content

function FilterFade(start,finish,step)
	for i = start,finish,0.03/step do
		Filter.BackgroundTransparency = i
		wait()
	end
	Filter.BackgroundTransparency = finish
end

Filter.Visible = true
for _,image in pairs(Content:GetChildren()) do image.Visible = false end
wait(Config.Padding_Time.Value)
for _,image in pairs(Content:GetChildren()) do
	image.Visible = true
	FilterFade(0,1,Config.Fade_Time.Value)
	wait(Config.Display_Time.Value)
	FilterFade(1,0,-Config.Fade_Time.Value)
	image.Visible = false
	wait(Config.Display_Time.Value)
end
wait(Config.Padding_Time.Value)
Screen.Background.Visible = false
FilterFade(0,1,Config.Fade_Time.Value)

Screen:Remove()

1 answer

✓ Accepted answer

What you should do is add a boolean value in the Player (when they join), thats something like "ViewedIntro", and when the intro has been viewed, have it go into the Player and check if said value is true or not before it plays the intro, if true, it removes the GUI, else, plays the GUI and sets the value to true, something like:

local legui = script.Intro:Clone()
game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:wait()
	if player:FindFirstChild("ViewedIntro") then
		if player.ViewedIntro.Value == true then return end
	else
		local newgui = legui:Clone()
		newgui.Parent = player.PlayerGui
		newgui.LocalScriptsName.Disabled = false	--[ Change "LocalScriptsName" to the name of the script in the GUI. ]
	end
end)

And for the GUI's code (Have the script's Disabled property set to true in the GUI):

local Screen = script.Parent
local Player = Screen.Parent.Parent
local Config = Screen.Config
local Filter = Screen.Filter
local Content = Screen.Content
 if not Player:FindFirstChild("ViewedIntro") then
	local HasViewed = Instance.new("BoolValue", Player)
	HasViewed.Value = true;
elseif Player:FindFirstChild("ViewedIntro") and Player.ViewedIntro.Value == true then
	Screen:remove()
end

function FilterFade(start,finish,step)
	for i = start,finish,0.03/step do
		Filter.BackgroundTransparency = i
		wait()
	end
	Filter.BackgroundTransparency = finish
end
 
Filter.Visible = true
for _,image in pairs(Content:GetChildren()) do image.Visible = false end
wait(Config.Padding_Time.Value)

for _,image in pairs(Content:GetChildren()) do
	image.Visible = true
	FilterFade(0,1,Config.Fade_Time.Value)
	wait(Config.Display_Time.Value)
	FilterFade(1,0,-Config.Fade_Time.Value)
	image.Visible = false
	wait(Config.Display_Time.Value)
end

wait(Config.Padding_Time.Value)
Screen.Background.Visible = false
FilterFade(0,1,Config.Fade_Time.Value)

Screen:remove()

Hope that helped (and worked), :) Regards, Xetrax

22 comments

0

Doesn't work Xetrax D:

0

O_O NOOOOOOOOOOOOOOOOOOOOOOO... Wait, the code is in a local script in the gui, right?

0

Yeah!

0

What is the Screen parented under???

0

The Script

0

-_- I mean how many .Parents until the script would have a direct path to the StarterGUI (I assume thats where you have all this shtuff...)

0

First its a script then it has a child of screen then the screen has a child of LocalScript

0

Mk, so... the main starter script has the Screen as its child, and the said screen has the script within it?

0

Also the screen has 3 frames and one Configuration displaying the time, fade time, and padding time.

0

Yeah.

0

I just found your error, you put the script containing the GUI, that gives the GUI to the player into starterGUI, this is multo male(very bad), place the script that has the Screen into workspace, and read my teensy edit I am just now making...

0

Edit finished, check it out.

0

Ok

0

One last touch, you might want to change Remove() to remove() no difference in function, just helps LUA to read it better.

0

Nothing changing for me...

0

...Did you do everything that I noted on? if so... then idk what the problem is, but somehow with most of my scripts, roblox seems to mess them up... :\

0

Can you do me a favor in which go to my roblox profile and take the intro model, so you can fix it if thats fine, because I did everything but it keeps repeating when reseted

0

Alright, and if i Fix it, I'll PM you with the new code.

0

Fixed it :P check your PMs.

0

I'll check it tomorrow but I'll accept answer for now I'm going to sleep that's why.

0

I'll check it tomorrow but I'll accept answer for now I'm going to sleep that's why.

0

I'll check it tomorrow but I'll accept answer for now I'm going to sleep that's why.

This discussion is preserved as it was. New answers, comments, and votes are closed.