So I made this script:
function onPlayerAdded()
local RandNum = Instance.new("NumberValue")
RandNum.Value = math.random(10)
for i,v in pairs(game.Players:GetChildren()) do
if v:IsA("Player") then
RandNum.Parent = v
RandNum.Name = "RandomNumber"
if RandNum.Value <= 3 then
game.Workspace.Sounds.Firework:Play()
local LuckMessage = Instance.new("Message", game.Workspace)
LuckMessage.Text = RandNum.Parent.Name .. " got lucky! Good job!"
wait(5)
LuckMessage:Destroy()
elseif RandNum.Value >= 8 then
local UnLuckMessage = Instance.new("Message", game.Workspace)
game.Workspace.Sounds.Suspense:Play()
UnLuckMessage.Text = RandNum.Parent.Name .. " got unlucky. Sorry."
wait(5)
UnLuckMessage:Destroy()
local UnLuckExplode = Instance.new("Explosion")
for i,v in pairs(game.Workspace:GetChildren()) do
if v:IsA("Model") then
UnLuckExplode.Parent = v.Torso
end
end
end
end
end
end
game.Players.PlayerAdded:connect(onPlayerAdded)
for _,v in pairs(game.Players:GetChildren()) do
if v:IsA("Player") then
onPlayerAdded()
end
end
And the Firework sound effect just goes on too long. If I try to put a wait(18) there, then it will delay the message. Can someone help me? Thanks! :)

3 comments
I know HOW, but I want to know how to do it without it delaying the message.
I'm sure that wouldnt Delay it..
Well, it did.