|
| 10 Sep 2013 03:57 PM |
I hate a sword which when you press p it "Places" it in your inventory (GUI) and removes the tool. It works apart from one thing, when I press P it places ALL the swords in my backpack into the GUI. At least it sorts them okay, but I'm not sure what causes it.
function backpack(key) name = play.Character.Name local item = script.Parent.Item.Value for i=1,14 do local slot = game.Players[name].PlayerGui.Inv.Frame:findFirstChild("Slot"..i) if slot.Empty.Value == true then if done == false then slot.Empty.Value = false slot.Gear.Value = true slot.Item.Value = item script.Parent:Remove() done = true end else faults = faults + 1 end if faults == 14 then script.Parent.Name = "Inventory Full" wait(3) script.Parent.Name = ""..item.."" end end end |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 10 Sep 2013 03:59 PM |
| Target the actual name of the tool |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2013 04:00 PM |
| I shouldn't need to, I've defined item as a Value inside the tool which has the same value as the Tool's name. This should only store one tool, but it seems for every tool it seems to run the backpack function. Do localscripts run even when they're not equipped or something? |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2013 04:02 PM |
Yes you can run a local script in the backpack even if its not equipped
atleast I think so as I mostly do something like that |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2013 04:03 PM |
| Any output? I may be able to fix it if there is output |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2013 04:04 PM |
There's no output, for all the script knows it's running as it's meant to.
@Funny, I have to go for tonight, I'll try playing with that tomorrow and I'll get back to you what I do to try and fix that. |
|
|
| Report Abuse |
|
|
08C
|
  |
| Joined: 26 Jan 2013 |
| Total Posts: 847 |
|
| |
|