I am making a battle royale game and... after you get a kill you see what you will be awarded with but I don't know what to use to connect the function with the game. Also, at line 33 = is underlined with a red colour, help?
01 | local kills = Instance.new( "IntValue" ) |
02 | local deaths = Instance.new( "IntValue" ) |
03 | local credits = Instance.new( "IntValue" ) |
04 | local level = Instance.new( "IntValue" ) |
05 | local wins = Instance.new( "IntValue" ) |
06 |
07 | kills.Name = "Kills" |
08 | deaths.Name = "Deaths" |
09 | credits.Name = "Credits" |
10 | level.Name = "Level" |
11 | wins.Name = "Wins" |
12 |
13 | kills.Value = 0 |
14 | deaths.Value = 0 |
15 | credits.Value = 0 |
the = operator SETS a variable, not compare
the == operator COMPARES two values and returns a boolean, as hulabee and incapaz are pointing out
also, trying to detect a kill is very hard, i would suggest adding code at where the tools (weapons) do damage to a humanoid, by adding an "if" for when the the health is taken for detecting if the health is <= 0 and sending a message to this script perhaps via RemoteEvents that the player has killed another player, and connect onKill with the message
Try replacing line 33 with this code.
if wins.Value == 2