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

How to make a winner script ?

I want to make a script that announce the winner. A player that have most kills at the end of the round. I am not very good at scripting so I made this lol...

repeat

wait(8)

local player

local m=Instance.new("Message")

m.Parent=game.Workspace

if player.kills.value (max)then

m.Text = (player.Name.."won the game")

wait(5)

m:remove()

until false

end

1 comment

0

You should edit your post to use Lua code formatting and also be more professional. In the future, it will get more helpful attention quicker.

1 answer

game.Players.PlayerAdded:connect(function(player)
	local m = Instance.new("Message")
	m.Parent = game.Workspace
	if player.Kills.Value == (Number Here) then
		m.Text = (player.Name.." won the game")
		wait(5)
		m:remove()
	end
end

This should work, try it and if it dosent tell me and i'll double check myself to see. You have to edit one thing and that is if player.Kills.Value == (Number Here) then. Change where it says (Number Here) and also change Kill.Value to wherever the kills value is located.

5 comments

0

hmmmmm

0

Its not working

0

it wont work trying to fo max kos, if you put a legit no. in then it will work.

0

It's still not working can you test it ?

0

I have tested and it works fine, as I said you will have to edit that one line to whereether you keep the kills value

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