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: DialogChoiceSelected

Previous Thread :: Next Thread 
pokelord910 is not online. pokelord910
Joined: 26 May 2009
Total Posts: 1045
05 Nov 2011 03:20 PM
sword = game.Lighting.SparklySword

script.Parent.DialogChoiceSelected:connect(function(player, shop)
local cash = player.leaderstats:FindFirstChild("Gold")
if cash ~= nil then
if cash.Value >= script.Parent.Cost.Value then
cash.Value = cash.Value - 200
local c1 = sword:Clone()
c1.Parent = player.Backpack
local c2 = sword:Clone()
c2.Parent = player.StarterGear
end
end
end)

output:
Sat Nov 05 20:10:08 2011 - Running Script "Workspace.Shopkeeper.Shopkeeper.Head.Dialog.DialogChoice.DialogChoice.DialogChoice.Script"
Sat Nov 05 20:10:08 2011 - DialogChoiceSelected is not a valid member of DialogChoice
Sat Nov 05 20:10:08 2011 - Script "Workspace.Shopkeeper.Shopkeeper.Head.Dialog.DialogChoice.Di", Line 3
Sat Nov 05 20:10:08 2011 - stack end

its meant to be a shop script
Report Abuse
dylanbuider is not online. dylanbuider
Joined: 14 Jun 2008
Total Posts: 17141
05 Nov 2011 03:24 PM
"DialogChoiceSelected is not a valid member of DialogChoice"

DialogChoiceSelected does not exist DialogChoice, bad parenting.


Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
05 Nov 2011 03:25 PM
DialogChoiceSelected is an event in the Dialog object, not DialogChoice.
Report Abuse
GoldenUrg is not online. GoldenUrg
Joined: 23 Aug 2009
Total Posts: 6428
05 Nov 2011 03:25 PM
DialogChoiceSelected event is a member of Dialog not of the DialogChoice itself.
Report Abuse
pokelord910 is not online. pokelord910
Joined: 26 May 2009
Total Posts: 1045
05 Nov 2011 03:30 PM
then how do i use it in a DialogChoice
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
05 Nov 2011 03:33 PM
dialog = script.Parent.Parent -- whatever the Dialog is
dialog.DialogChoiceSelected:connect(function(plr, choice) -- i think thats right :l

-- plr is the player who chose something, choice is the dialogchoice that was selected
-- usually people just use the name of the dialogchoice to determine what happens
-- ex. if this is a weapon shop, name each of the dialogchoices the name of the
-- weapons that they give you, then just go like this:
game.Lighting[choice.Name]:Clone().Parent = plr.Backpack
-- or something liek dat

end)
Report Abuse
pokelord910 is not online. pokelord910
Joined: 26 May 2009
Total Posts: 1045
05 Nov 2011 03:34 PM
ok...
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