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

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

Asked by 9 years ago

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

Log in to vote
0
Answered by
Xetrax 85
9 years ago

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

0
Doesn't work Xetrax D: alan3401 28 — 9y
0
O_O NOOOOOOOOOOOOOOOOOOOOOOO... Wait, the code is in a local script in the gui, right? Xetrax 85 — 9y
0
Yeah! alan3401 28 — 9y
0
What is the Screen parented under??? Xetrax 85 — 9y
View all comments (18 more)
0
The Script alan3401 28 — 9y
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...) Xetrax 85 — 9y
0
First its a script then it has a child of screen then the screen has a child of LocalScript alan3401 28 — 9y
0
Mk, so... the main starter script has the Screen as its child, and the said screen has the script within it? Xetrax 85 — 9y
0
Also the screen has 3 frames and one Configuration displaying the time, fade time, and padding time. alan3401 28 — 9y
0
Yeah. alan3401 28 — 9y
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... Xetrax 85 — 9y
0
Edit finished, check it out. Xetrax 85 — 9y
0
Ok alan3401 28 — 9y
0
One last touch, you might want to change Remove() to remove() no difference in function, just helps LUA to read it better. Xetrax 85 — 9y
0
Nothing changing for me... alan3401 28 — 9y
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... :\ Xetrax 85 — 9y
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 alan3401 28 — 9y
0
Alright, and if i Fix it, I'll PM you with the new code. Xetrax 85 — 9y
0
Fixed it :P check your PMs. Xetrax 85 — 9y
0
I'll check it tomorrow but I'll accept answer for now I'm going to sleep that's why. alan3401 28 — 9y
0
I'll check it tomorrow but I'll accept answer for now I'm going to sleep that's why. alan3401 28 — 9y
0
I'll check it tomorrow but I'll accept answer for now I'm going to sleep that's why. alan3401 28 — 9y
Ad

Answer this question