So I tried to make a script that says if you have no gear in your inventory, the textlabel would say "You have no gear" But it doesn't work. Here is the script:
if Players.StarterPack.empty then wait(1) TextLabel.Text= "No gear in your inventory!" end
And this a another script inside the text label that doesnt work.
if Players.StarterPack = "Knife" = true then wait(1) TextLabel.Text= "you have a gear!" end
This means that if one player has the knife, it says you have the knife. Can you help me?
Oh, and only one person gets the knife.
... We have some serious scripting issues here....
local player = game.Players.LocalPlayer repeat wait() until player:findFirstChild"Backpack" local bk = player.Backpack if #bk:GetChildren()==0 then print('empty') else print'not empty' end bk.ChildAdded:connect(function(ch) print'not empty' end) bk.ChildRemoving:connect(function(ch) if #bk:GetChildren()==0 then print('empty') end end)
I changed it but it still doesnt work.
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)