|
| 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 |
|
|
|
| 05 Nov 2011 03:24 PM |
"DialogChoiceSelected is not a valid member of DialogChoice"
DialogChoiceSelected does not exist DialogChoice, bad parenting.
|
|
|
| Report Abuse |
|
|
|
| 05 Nov 2011 03:25 PM |
| DialogChoiceSelected is an event in the Dialog object, not DialogChoice. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 05 Nov 2011 03:30 PM |
| then how do i use it in a DialogChoice |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|