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

How can I make player's Intro turned off if player dies once?

Asked by 8 years ago

I want to make player's starter intro turned off if player dies once after the intro ends.

01wait(1)
02b = script.Parent.TextLabel
03wait(1)
04 
05b.Text = "W"
06wait(0.2)
07b.Text = "We"
08wait(0.2)
09b.Text = "Wel"
10wait(0.2)
11b.Text = "Welc"
12wait(0.2)
13b.Text = "Welco"
14wait(0.2)
15b.Text = "Welcom"
View all 89 lines...

3 answers

Log in to vote
0
Answered by 8 years ago

Answer: I recommend putting the StarterGui inside of the ServerScriptService with a script and make an function for the player added event. Then in the event clone the Gui and put it inside of the Player Gui and the player is already the argument of the function. Therefore, you can just clone the Gui under the script and place it inside of the PlayerGui. Then the function for placing the Gui into the PlayerGui will run once and that will be when the player joins only.

Thanks for reading my answer and I hope it helped you in one way or another.

~~ KingLoneCat

0
um.. can u plz tell me as code? sorry, cuz i can't understand this...(also i am foreigner) Sorry. Scripter_Blan 25 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

1st I think you need to look at how inefficient this code is, you have a lot of duplicated code which is not good at all.

This is simple to fix with functions, you can also use multiple functions for different tasks:-

01--- just an example of how you can simply delay printing
02local function delayedPrint(text, textLabel, tme)
03    for i=1, #text do -- from the 1st character to the last character
04        textLabel.Text = text:sub(1,i)
05        wait(tme)
06    end
07end
08 
09-- an example of when the same text needs to be printed but with a delay and a repeate count
10local function delayedTextSwitch(text1, text2, textLabel, del, repCount)
11    for i=1, repCount do
12        wait(del)
13        textLabel.Text = text1
14        wait(del)
15        textLabel.Text = text2
View all 63 lines...

There are multiple ways that you can turn off the intro after the player dies but I do not know where you are running this scrip and how it is added to the player.

I hope you can see why I have change this code but pls comment if you do not understand how this works.

Hope this helps

Log in to vote
0
Answered by 8 years ago

Add this to the first line of your code:

1local startergui = game.StarterGui
2StarterGui.ResetPlayerGuiOnSpawn = false

That's all you have to do. If this worked - vote this answer up and accept it as an answer.

Answer this question