|
| 30 Dec 2013 10:15 AM |
The one I've been using for a while doesn't work anymore
This is "BackpackScript" local debris = game:service("Debris") Main = script.Parent ViewStats = Main.ViewStats Window = Main.Window Player = script.Parent.Parent.Parent if Player:findFirstChild("GUIBackpack") then Bp = Player["GUIBackpack"] else Bp = Instance.new("Model") Bp.Name = "GUIBackpack" Bp.Parent = Player end
function Clean() Slots = Window:GetChildren() for i=1,#Slots do if Slots[i].Name ~= "SlotInfo" then Ch = Slots[i]:GetChildren() for l=1,#Ch do Ch[l]:Remove() end end end end
function Update() Things = Bp:GetChildren() Clean() for i=1,#Things do if true then local B = nil local O = nil NotRun,Empty = pcall(function() if Things[i].TextureId == "" then error() end B = Instance.new("ImageButton") B.BackgroundTransparency = 1 B.Image = Things[i].TextureId B.Size = UDim2.new(1,0,1,0) B.Name = Things[i].Name O = Instance.new("ObjectValue") O.Value = Things[i] O.Name = "Object" O.Parent = B B.Parent = Slots[i] end) if NotRun == false then B = Instance.new("TextButton") B.BackgroundTransparency = 1 B.Text = Things[i].Name B.Size = UDim2.new(1,0,1,0) B.Name = Things[i].Name O = Instance.new("ObjectValue") O.Value = Things[i] O.Name = "Object" O.Parent = B B.Parent = Slots[i] end B.MouseButton1Click:connect(function() if O.Value.className == "Tool" or O.Value.className == "HopperBin" then O.Value.Parent = Player.Backpack else N = Instance.new("StringValue") N.Name = "NoPick" N.Parent = O.Value debris:AddItem(N,4) O.Value.Parent = workspace pcall(function() O.Value.CFrame = Player.Character.Head.CFrame + Vector3.new(0,3,0) end) pcall(function() O.Value:MoveTo(Player.Character.Head.Position + Vector3.new(0,3,0)) end) end end) B.MouseButton2Click:connect(function() O.Value:Remove() end) end end end
Update()
Bp.ChildAdded:connect(Update) Bp.ChildRemoved:connect(Update)
function UpdateVs() Vsp = Slots[#Slots]:GetChildren() for i=1,#Vsp do Vsp[i]:Remove() end Stats = ViewStats:GetChildren() for i=1,#Stats do if not Player:findFirstChild(Stats[i].Name) then Nu = Instance.new("NumberValue") Nu.Name = Stats[i].Name Nu.Parent = Player end end for i=1,#Stats do if true then local B = nil local O = nil B = Instance.new("TextLabel") B.BackgroundTransparency = 1 B.Text = Stats[i].Name..": "..Player[Stats[i].Name].Value B.Size = UDim2.new(1,0,1/#Stats,0) B.Position = UDim2.new(0,0,(1/#Stats)*(i-1),0) B.Name = Stats[i].Name B.Parent = Slots[#Slots] Player[Stats[i].Name].Changed:connect(UpdateVs) end end end
UpdateVs()
This is "unPack Script" ap = script.Parent:GetChildren() for i=1,#ap do if ap[i] ~= script then tp = ap[i]:GetChildren() for l=1,#tp do tp[l].Parent = game[ap[i].Name] end end end script.Parent:Remove()
There is also a String Value "AllowPick" that has to be put in the things that can be picked up
There is also a "PickUp tool" int he starter pack.
tl;dr What goes wrong is that you can pick it up witht he tool but it isn't transferred to the GUI. Erroe in the output is "Masada is not a valid member of BackPackGUI".
so uh
yeah
|
|
|
| Report Abuse |
|