Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Tool script still doen't work?

So here is the script:

local player = game.Players.LocalPlayer
repeat wait() until player:findFirstChild"Backpack"
local bk = player.Backpack
if #bk:GetChildren()==0 then 
    script.Parent.Text = "You are a stranger!"
else
    script.Parent.Text = "You are the murderer!"
end
bk.ChildAdded:connect(function(ch)
    script.Parent.Text = "You are the murderer!"
end)
bk.ChildRemoving:connect(function(ch)
    if #bk:GetChildren()==0 then
        script.Parent.Text = "You are a stranger!"
    end
end)


But for some reason, when the players backpack is empty or full, the textlabel doesn't work. Help much?

1 answer

✓ Accepted answer

Maybe the 2nd line is wrong? repeat wait() until player:findFirstChild"Backpack" Shouldnt it be: repeat wait() until player:findFirstChild("Backpack")

1 comment

0

No, it doesn't work cause i didnt put it in a local script

This discussion is preserved as it was. New answers, comments, and votes are closed.