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

Tool script still doen't work?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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

0
No, it doesn't work cause i didnt put it in a local script PyccknnXakep 1225 — 10y
Ad

Answer this question