Script Isn't functioning correctly?
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)