Guys I have a prob. In this following script I have a math.random function that is called when a player dies, and changes the deathmessage that apears on screen when a player dies. But when the player dies for a second time the script doesn't change the message i don't know why.. Here's the script:
function changemessage()
local messages = math.random(5)
print(messages)
wait(.1)
if messages == 1 then
text.Text = "You did your best!"
end
if messages == 2 then
text.Text = "Wait, whaat!?"
end
if messages == 3 then
text.Text = "It's ok!"
end
if messages == 4 then
text.Text = "You can't do better?"
end
if messages == 5 then
text.Text = "Don't give up!"
end
end
--When player dies it calls "changemessage()".
Anyone willing to help for some rep?

7 comments
Ty!
No Problem! Tip: Renember math.floor always rounds up! and math.ceil rounds down! Also, math.random can generate decimals!
It fixed the choosing things at random but it still wont change the text Idk how.. Any Idea how to fix that? :3
Hummm you would need to give me the entire code for that
You could post another question
All Right. I'll do that.
Done. Here it is: https://scriptinghelpers.org/questions/50510/how-do-i-make-this-script-change-the-text-of-a-gui-when-the-player-dies