im2awsm
|
  |
| Joined: 25 Aug 2010 |
| Total Posts: 2295 |
|
|
| 12 Nov 2011 05:51 PM |
Hi, i was thinking, would it be possible to make a sort of crafting system? Like, when you clicked a button, it checked if you had (example) a box of SPAM (yes the food, lawl) and a cannon, it checked then removed those items and gave you a new one from lighting, the Spam Cannon. I am HORRIBLE with onClicked, i dont even know if thats what its called... So, if anyone know how to do this, could you answer on the forum? To count this as a help, not a request, i made a rough copy of the script, that is bound not to work, as i cant think straight today:
begin onClicked if Player.Backpack has SpamBox 1 if Player.Backpack has Cannon 1 --Blargh.. hate this.. wont work, horrible. then Player.Backpack.SpamBox:remove() Player.Backpack.Cannon:remove() --Problem here..will this remove ALL of the spamboxes and cannons they have!?! game.Lighting.SpamCannon:clone() SpamCannon.Parent = Player --Ok, i suck at this. elseif --is it else if or elseif? BLARGH end
Wow that looks horrible, well, anyone? |
|
|
| Report Abuse |
|
|
im2awsm
|
  |
| Joined: 25 Aug 2010 |
| Total Posts: 2295 |
|
|
| 12 Nov 2011 05:52 PM |
| Please dont hate if thats what your expecting to do :P |
|
|
| Report Abuse |
|
|
|
| 12 Nov 2011 05:59 PM |
script.Parent.MouseButton1Down:connect(function()
local Obj1 = Player.Backpack:FindFisrtChild("SpamBox") local Obj2 = Player.Backpack:FindFisrtChild("Cannon")
if Obj1 ~= nil and Obj2 ~= nil then Obj1:remove() Obj2:remove() game.Lighting.SpamCannon:clone().Parent = Player.Backpack else return end end end)
|
|
|
| Report Abuse |
|
|
im2awsm
|
  |
| Joined: 25 Aug 2010 |
| Total Posts: 2295 |
|
|
| 12 Nov 2011 06:07 PM |
| Thank you very much! Ill try it now. |
|
|
| Report Abuse |
|
|
|
| 12 Nov 2011 06:10 PM |
| I can see how that script two above won't work without having to test it. |
|
|
| Report Abuse |
|
|
im2awsm
|
  |
| Joined: 25 Aug 2010 |
| Total Posts: 2295 |
|
| |
|
|
| 12 Nov 2011 06:19 PM |
I have a feeling Darkmist has no idea what 'return end' really does, he just uses it.
Simply delete the consecutive words of: 'else return end' and you will be fine. |
|
|
| Report Abuse |
|
|
|
| 12 Nov 2011 06:39 PM |
Did you not see this? local Obj1 = Player.Backpack:FindFisrtChild("SpamBox") local Obj2 = Player.Backpack:FindFisrtChild("Cannon")
Needs to be local Obj1 = Player.Backpack:findFirstChild("SpamBox") local Obj2 = Player.Backpack:findFirstChild("Cannon") |
|
|
| Report Abuse |
|
|
|
| 12 Nov 2011 06:58 PM |
| The only difference I see is the 'F' is made into 'f'...won't change a thing. |
|
|
| Report Abuse |
|
|
|
| 12 Nov 2011 07:01 PM |
| Look how the word 'first' is spelled. |
|
|
| Report Abuse |
|
|
| |
|
im2awsm
|
  |
| Joined: 25 Aug 2010 |
| Total Posts: 2295 |
|
|
| 12 Nov 2011 10:07 PM |
| Does Darkmists script need to be a local script or normal? |
|
|
| Report Abuse |
|
|
| |
|