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

Help With Intro For Game?

Asked by
Scootakip 299 Moderation Voter
8 years ago
local player = game.Players.LocalPlayer
print "1"
if player.IntroRan.Value == 0 then
local introthing = game.Players.LocalPlayer.PlayerGui.Intro
introthing.Greeting.Text = "Welcome to The Door, "..player.Name.. ""
introthing.Music.TimePosition = 15
introthing.Logo.ImageTransparency = 1
introthing.Greeting.BackgroundTransparency = 1
introthing.Greeting.TextTransparency = 1
local IV = 10
introthing.Music:Play()
while IV ~= 0 do
    introthing.Logo.ImageTransparency = introthing.Logo.ImageTransparency - .1
    introthing.Greeting.BackgroundTransparency = introthing.Greeting.BackgroundTransparency - .1
    introthing.Greeting.TextTransparency = introthing.Greeting.TextTransparency - .1 
    IV = IV - 1
    wait(.1)
end

introthing.Music.Volume = 1
local VE = 100
while VE ~=0 do
    introthing.Music.Volume = introthing.Music.Volume - .01
    VE = VE - 1
    wait(.1)
end
introthing.Music:Stop()
local IV2 = 10
while IV2 ~= 0 do
    introthing.Logo.ImageTransparency = introthing.Logo.ImageTransparency + .1
    introthing.Greeting.BackgroundTransparency = introthing.Greeting.BackgroundTransparency + .1
    introthing.Greeting.TextTransparency = introthing.Greeting.TextTransparency + .1 
    IV2 = IV2 - 1
    wait(.1)
end
player.IntroRan.Value = 1
end

This intro only works in Roblox Studio, not in actual Roblox and I have no clue why. Someone help me fix this? Thanks.

1 answer

Log in to vote
0
Answered by 8 years ago

Here are a few tips:

  • I would recommend using game.Players.PlayerAdded:connect(function(p) --[[ intro code here ]]-- end) to do it, because you don't have to reference the player, and it only triggers when someone joins.

  • If you're not going to do the function, then set IntroRan to 1 right at the start so it doesn't replicate it with only half of the intro done.

  • You could make your intro easier/faster to edit doing "Welcome to " ..game.Name.. ", " ..player.Name

  • In your whiles, make it check for IV > 0 not IV ~= 0, because it might go into negatives forever.

The problem with your script is that IntroRan may need to load into the player a bit after it's indexed. You should try making a local for it (E.G, local IntroRan = player:WaitForChild("IntroRan")) and/or waiting for it to exist (E.G, repeat wait() until IntroRan) Hope I helped!

Ad

Answer this question