Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't this function firing?[FIXED]

Asked by 10 years ago

So my script is supposed to change and change a value again when a person leaves and connects. I will only show you a portion of the script but here it is:

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
for i, v in pairs(game.StarterGui.Leaderboard.Players:GetChildren()) do
if v:IsA("StringValue") then
if v.Name == "Player1" then
if v.Value == "" then
v.Value = char.Name 
end 

and the playeremoved function:

game.Players.PlayerRemoving:connect(function(plrl)
for i, v in pairs(game.StarterGui.Leaderboard.Players:GetChildren()) do
    if v:IsA("StringValue") then
if v.Name == "Player1" then
if v.Value == plrl.Name then
v.Value = ""
end 
0
I forgot to add end) end) for the first part and end) for the second! deputychicken 226 — 10y
0
I learned the parent had to be workspace. deputychicken 226 — 10y

Answer this question