My script is supposed to display +, if there are multiple eliminations and 0 deaths, and - for when there are 0 eliminations and multiple deaths. My script is
local player = game.Players.LocalPlayer local leaderstats = player:WaitForChild("leaderstats") local elims = leaderstats:WaitForChild("Eliminations") local deaths = leaderstats:WaitForChild("deaths") local statisticsMenu = player.PlayerGui:WaitForChild("statistics") elims.Changed:Connect() if leaderstats.Eliminations.Value >= 0 and leaderstats.deaths.Value == 0 then player.PlayerGui.statistics.Frame.kdRatioNumber.Text = "+" deaths.Changed:Connect() if leaderstats.Eliminations.Value == 0 and leaderstats.deaths.Value >= 0 then player.PlayerGui.statistics.Frame.kdRatioNumber.Text = "-" end end
Shortly, you did ':Connect()' with the argument empty. There must be argument of 'function()' or you can call a function. Try to fix that; hope it was useful. Message me for further questions!
To make the .Changed event work, you need to do :Connect(function() not :Connect(), also, you made some mistakes on if statements. So your script will be like this:
local player = game.Players.LocalPlayer local leaderstats = player:WaitForChild("leaderstats") local elims = leaderstats:WaitForChild("Eliminations") local deaths = leaderstats:WaitForChild("deaths") local statisticsMenu = player.PlayerGui:WaitForChild("statistics") elims.Changed:Connect(function() if leaderstats.Eliminations.Value >= 0 and if leaderstats.deaths.Value == 0 then player.PlayerGui.statistics.Frame.kdRatioNumber.Text = "+" end end end) deaths.Changed:Connect(function() if leaderstats.Eliminations.Value == 0 and if leaderstats.deaths.Value >= 0 then player.PlayerGui.statistics.Frame.kdRatioNumber.Text = "-" end end end)
I hope this helped you! edit: Forgot to make :Connect(function() on deaths.Changed