Sadcamp
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 21729 |
|
|
| 17 Nov 2012 01:09 PM |
Won't give me tools.
Food/Tools are in the Lighting.
Script:
script.Parent.DialogChoiceSelected:connect(function(player, choice) if (choice == script.Parent.Choice1) then -- if (player.Backpack:findFirstChild("Beretta")==nil) then pistol = game.Lighting["Cheese Burger", "Turkey Leg", "Chocolate Milk", "Vaktus Action Figure"]:clone() pistol.Parent = player.Backpack -- end end if (choice == script.Parent.Choice2) then -- if (player.Backpack:findFirstChild("Beretta")==nil) then pistol = game.Lighting["Squid Burger"]:clone() pistol.Parent = player.Backpack -- end end if (choice == script.Parent.Choice3) then -- if (player.Backpack:findFirstChild("Beretta")==nil) then pistol = game.Lighting["Cheese Burger"]:clone() pistol.Parent = player.Backpack -- end end if (choice == script.Parent.Choice4) then -- if (player.Backpack:findFirstChild("Beretta")==nil) then pistol = game.Lighting["Sandwich"]:clone() pistol.Parent = player.Backpack -- end end end)
» Solong66 For Vaktovian General! « |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2012 01:10 PM |
Make it repeat. Right now it only checks once. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 17 Nov 2012 01:11 PM |
pistol = game.Lighting["Cheese Burger", "Turkey Leg", "Chocolate Milk", "Vaktus Action Figure"]:clone() -- What are you trying to do here?
Always post output.
|
|
|
| Report Abuse |
|
|
Sadcamp
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 21729 |
|
|
| 17 Nov 2012 01:13 PM |
Output after chatting with the dialog says: Done
» Solong66 For Vaktovian General! « |
|
|
| Report Abuse |
|
|
Sadcamp
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 21729 |
|
|
| 17 Nov 2012 01:14 PM |
@Michael
Remind me the "Repeat" Command?
» Solong66 For Vaktovian General! « |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2012 01:15 PM |
| I think you just add repeat to the bottom...I could be wrong. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 17 Nov 2012 01:16 PM |
Well this, pistol = game.Lighting["Cheese Burger", "Turkey Leg", "Chocolate Milk", "Vaktus Action Figure"]:clone() Is your problem line. It looks like you're trying to clone all these things. You can't do it like this.
If you were going to choose one at random you would put,
Choices = {"Cheese Burger","Turkey Leg","Chocolate Milk","Vaktus Action Figure"} pistol = game.Lighting[Choices[math.random(1,#Choices)]]:clone()
If you wanted them all you would run a loop,
Choices = {"Cheese Burger","Turkey Leg","Chocolate Milk","Vaktus Action Figure"} for n,o in pairs(Choices)do o = game.Lighting[o]:clone() o.Parent = Player.Backpack end |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 17 Nov 2012 01:18 PM |
@mich don't help if you don't know what you're doing. He's using an event, which means whenever the event happens, the function fires. Making a loop with the event will end up giving him 4Mil+ cheeseburgers. |
|
|
| Report Abuse |
|
|
Sadcamp
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 21729 |
|
|
| 17 Nov 2012 01:22 PM |
@1TopCop
14:21:12 - Workspace.Welcome to VAKDonalds.Head.Dialog.Script:29: 'until' expected (to close 'repeat' at line 28) near 'end'
14:21:12 - exception while signalling: tr1::bad_weak_ptr
» Solong66 For Vaktovian General! « |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 17 Nov 2012 01:23 PM |
| Just remove the repeat. Do what I said. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2012 01:27 PM |
| Sorry Im just tying to help... |
|
|
| Report Abuse |
|
|
Sadcamp
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 21729 |
|
|
| 17 Nov 2012 01:27 PM |
@1topcop
So this is what my program thing looks like now
script.Parent.DialogChoiceSelected:connect(function(player, choice) if (choice == script.Parent.Choice1) then Choices = {"Cheese Burger","Turkey Leg","Chocolate Milk","Vaktus Action Figure"} for n,o in pairs(Choices)do o = game.Lighting[o]:clone() o.Parent = Player.Backpack end
Is that correct?
(I Removed all Repeats)
» Solong66 For Vaktovian General! « |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 17 Nov 2012 01:29 PM |
You're missing two ends. for loops need ends, if statements need ends, and functions need ends.
Your end stack should look like end end end) |
|
|
| Report Abuse |
|
|