Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Re: Why does the script not switch between the options?

DeathMessages = {"Not bad... For an idiot that is...", "Still acting stubborn?", "Do you really want that cake?"}
ChooseOne = DeathMessages[math.random(#DeathMessages)];


game:GetService('Players').PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").Died:connect(function()
           local bc = BrickColor.new("Neon orange")
				game.StarterGui:SetCore("ChatMakeSystemMessage", {
				Text = ChooseOne;
				Font = Enum.Font.Arial;
				Color = bc.Color;
				FontSize = Enum.FontSize.Size96;	
			})
        end)
    end)
end)

so i think i got it right, but it only says in the chat: " Still acting stubborn?" every time i die it doesn't switch to the other ones.

1 answer

✓ Accepted answer

Hey RealRexTeam,

The reason that it keeps popping up only one message is because the math.random keeps being called only once, you just need to move the ChooseOne variable inside of the function so that it is called every time the function executes. Move it into the .CharacterAdded function so it creates a new text every time the player spawns.

##Well, I hope I helped.

~~ KingLoneCat

This discussion is preserved as it was. New answers, comments, and votes are closed.