generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Dialog Giver Problem?

Previous Thread :: Next Thread 
Sadcamp is not online. 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
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 01:10 PM
Make it repeat.
Right now it only checks once.
Report Abuse
1Topcop is not online. 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 is not online. 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 is not online. 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
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 01:15 PM
I think you just add repeat to the bottom...I could be wrong.
Report Abuse
1Topcop is not online. 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 is not online. 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 is not online. 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 is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
17 Nov 2012 01:23 PM
Just remove the repeat. Do what I said.
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 01:27 PM
Sorry Im just tying to help...
Report Abuse
Sadcamp is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image