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

Why is my intro doing this?

Asked by 9 years ago

This is my intro script, what it does is position the camera at a certain point. It then puts the first intro ("Intro") into the players current camera. All three intro objects are in starter gui.

After twenty seconds the first intro goes away, and IntroTwo is in the current camera now. However, if they the skip button it clears all the children in the camera. It then adds MenuCameraPosition to the camera.

The problem is that the second intro still appears when you press skip. What should I do to keep the other intro's from appearing if they press skip?

wait()
game.StarterGui:SetCoreGuiEnabled(0, false)
game.StarterGui:SetCoreGuiEnabled(2, false)

local Intro = script.Parent:WaitForChild("Intro"):Clone()
Intro.Parent = game.Workspace.CurrentCamera

wait(3)--Wait for the stuff to load

local cam = Workspace.CurrentCamera

cam.CameraType = "Scriptable"
cam.CoordinateFrame = CFrame.new(-74.77, 7.73, 107.733)
cam.Focus = CFrame.new(-73.888092, 8.4218502, 107.846222, 2, 0, 0, 0, 1, 0, 0, 0, 1)


-------------------------------------------

local IntroGui = script.Parent.IntroGui
local SkipButton = IntroGui.Content.Pages.Skip
local SadSong = IntroGui.SadSong

---------------------------
function OpenMenu()
for i = 0.5,0,-0.01 do
SadSong.Volume = i
wait()
end
wait()

cam:ClearAllChildren()

local a = script.Parent.MenuCameraPosition:Clone()
a.Parent = game.Workspace.CurrentCamera


IntroGui:Remove()

local Menu = script.Parent.Menu ---------
local Holder = Menu.Holder ---------VARIABLES----------
local PianoSound = Menu.PianoSound ---------

Menu.LocalScript.Disabled = false --Run Menu scripts
PianoSound:Play() --Play Music
Holder.Visible = true --Make Menu visible
script.Disabled = true
end


--------------------------


SkipButton.MouseButton1Down:connect(function()
OpenMenu() ---Closes Intro and opens Menu
end)


function IntroTwo()
Intro:Remove()
Intro2 = script.Parent.IntroTwo:Clone()
Intro2.Parent = game.Workspace.CurrentCamera
end

wait(20)
IntroTwo()

1 answer

Log in to vote
0
Answered by 9 years ago

I read through your script many times. I recommend while waiting to debug act like the computer and think logically like I(think I) have done. The first thing I noticed is that your event on line 53 can be activated whenever, which makes sense. The second thing I noticed was that on line 64 and 65 functions are called to activate introtwo regardless of if the skip button was pressed. I assume this is the error. What I would do is at the top copy and paste this

skip = false

then, on line 54 (right before you call the function openmenu(), put

skip = true

THEN.... change line 64 and 65 from

wait(20)
IntroTwo()

to

if skip == true then
wait(20)
IntroTwo()
end

Hopes this helps! PM me @tkddude2 on roblox when your game is done!

Ad

Answer this question