Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 12:11 PM |
As a lot of you can probably already tell, this is a script that goes with dialog. The script works fine for the first option, and if you choose the wrong option, you are killed. However, the second option doesn't make the object "ElectricBarrier" invisible and change its collide settings to false, then back. I'm not necessarily new to scripting, but I'm not very good either, so I'm sorry if there's a super obvious answer. The output doesn't say anything at all.
workspace.TestCharacter.Head.Dialog.DialogChoiceSelected:connect(function(player,choice) if choice.Name == "THIS OPTION KILLS YOU" then player.Character.Humanoid.Health= 0 elseif choice.Name == "THIS OPTION ALLOWS YOU TO LIVE" then workspace.ElectricBarrier.Transparency = 1 workspace.ElectricBarrier.CanCollide = false wait(2) workspace.ElectricBarrier.Transparency = 0 workspace.ElectricBarrier.CanCollide = true end end)
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 06 Oct 2012 12:16 PM |
workspace.TestCharacter.Head.Dialog.DialogChoiceSelected:connect(function(player,choice) if choice.Name == "THIS OPTION KILLS YOU" then player.Character.Humanoid.Health= 0 elseif choice.Name == "THIS OPTION ALLOWS YOU TO LIVE" then game.workspace.ElectricBarrier.Transparency = 1 game.workspace.ElectricBarrier.CanCollide = false wait(2) game.workspace.ElectricBarrier.Transparency = 0 game.workspace.ElectricBarrier.CanCollide = true
end end)
|
|
|
| Report Abuse |
|
|
Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 12:21 PM |
Tried this, still not affecting ElectricBarrier in any way. Do I need to have it in the same model as the script and change game.workspace.ElectricBarrier and put it into TestCharacter?
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 12:23 PM |
workspace.TestCharacter.Head.Dialog.DialogChoiceSelected:connect(function(player,choice) if choice.Name == "THIS OPTION KILLS YOU" then player.Character.Humanoid.Health= 0 end elseif choice.Name == "THIS OPTION ALLOWS YOU TO LIVE" then workspace.ElectricBarrier.Transparency = 1 workspace.ElectricBarrier.CanCollide = false end)
|
|
|
| Report Abuse |
|
|
Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 12:27 PM |
Still doesn't work.
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 06 Oct 2012 01:18 PM |
| Wait, how is choice set up? Is it a model? Try going game.Workspace.choice. |
|
|
| Report Abuse |
|
|
Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 01:32 PM |
http://www.roblox.com/Model-of-my-problem-item?id=94407619
Here's a model of the model.
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 06 Oct 2012 01:38 PM |
Try this:
http://www.roblox.com/Try-this-item?id=94408641
May not work due to the spaces, try editing it to your needs. |
|
|
| Report Abuse |
|
|
Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 01:46 PM |
Hm. Neither one works now.
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 06 Oct 2012 01:48 PM |
| Did you try taking out the spaces of the dialogue options and out of the script where it lists the dialogue options? e.g. THISONELETSYOULIVE? |
|
|
| Report Abuse |
|
|
Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 01:58 PM |
i am such an idiot.
the script had "THIS OPTION LETS YOU LIVE" and the dialog had "THIS OPTION ALLOWS YOU TO LIVE"
brb banging my head against a wall for seven hours
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 01:59 PM |
What the heck, it still didn't work.
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 02:01 PM |
I give up for now. I'm just gonna focus on building.
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 02:02 PM |
| crystoh, you ended the if before the elseif... |
|
|
| Report Abuse |
|
|
Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 02:05 PM |
@shay
in which one?
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 02:07 PM |
| sorry, i was looking at xxsomeones code... ill look into the model for you if you want |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 02:09 PM |
| doesn't workspace need a Capital... on the first line |
|
|
| Report Abuse |
|
|
Crystoh
|
  |
| Joined: 28 May 2010 |
| Total Posts: 16458 |
|
|
| 06 Oct 2012 02:22 PM |
No, like I said the first half of code works fine.
~Crystoh, King of the Moosicorn~ |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 02:28 PM |
| I don't know then, i looked at the wiki and your relevance was fine ^_^ |
|
|
| Report Abuse |
|
|