Okay I made a intro (Music included) and I want to make it so once a player joins it starts the intro, intro is in startergui but every time a player dies it starts over and over.. you get the point how would i make it so it only plays once even for new players but if you die it doesn't play? if you need more information or don't get it post in comments please!
Your problem is that your "intro" is located in StarterGui. All instances in this service are replicated to the PlayerGui container inside of every player, and are reset every time the player re-spawns mostly for updating purposes.
You would want to store your GUI in the (ReplicatedStorage) service or ServerStorage service, so that you may clone them into the player's PlayerGui only when they join the server. After they re-spawn, the GUI would be cleared, and no longer replicate.
local file = game:GetService('ReplicatedStorage'):WaitForChild('GUI') game:GetService('Players').PlayerAdded:connect(function (player) repeat until player.Changed:wait() == 'Character' print('character') --clone Gui into `player.PlayerGui` newGui = file:clone() newGui.Parent = player.PlayerGui end) -- which is pretty much similar to Goulstem CharacterAdded:wait()
Instead of using the CharacterAdded
event, just wait until the character loads inside of a PlayerAdded
event.
Example;
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:wait() --code end)