game:GetService("Players").PlayerAdded:Connect(function(player) --<this line doesnt work
	print("got past player added function") --doesnt print
	while true do	
		wait()
		if player:WaitForChild("leaderstats").Deaths.Value == 0 then --can't divide by 0 
			script.Parent.Text = player:WaitForChild("leaderstats").Kills.Value
		elseif player:WaitForChild("leaderstats").Deaths.Value >= 1 then
		end 
	end
	while true do
		local kdr = player:WaitForChild("leaderstats").Kills.Value/player:WaitForChild("leaderstats").Deaths.Value
		wait()
		if string.len(kdr) >= 5 then
			script.Parent.Text =string.sub(kdr,1,5)
		elseif string.len(kdr) <= 4 and string.len(kdr) ~= 1 then
			script.Parent.Text = "Ratio"..kdr
		elseif string.len(kdr) == 1 and player:WaitForChild("leaderstats").Deaths.Value ~= 0 then
			script.Parent.Text = "Ratio"..kdr
		end
	end
end)

3 comments

0

there are no errors aswell

0

There are several issues with it, redundancies etc... Though you've likely used the wrong Script for the correlating environment; what type of Script are you using, and where is it located?

0

it's a local script located in a textLabel, which is inside of a rame, screen gui, and startgui