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: Lol subject title

Previous Thread :: Next Thread 
Crystoh is not online. 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 is not online. 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 is not online. 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
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
shaythegoon is not online. shaythegoon
Joined: 18 Jul 2010
Total Posts: 630
06 Oct 2012 02:02 PM
crystoh, you ended the if before the elseif...
Report Abuse
Crystoh is not online. 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
shaythegoon is not online. shaythegoon
Joined: 18 Jul 2010
Total Posts: 630
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
shaythegoon is not online. shaythegoon
Joined: 18 Jul 2010
Total Posts: 630
06 Oct 2012 02:09 PM
doesn't workspace need a Capital... on the first line
Report Abuse
Crystoh is not online. 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
shaythegoon is not online. shaythegoon
Joined: 18 Jul 2010
Total Posts: 630
06 Oct 2012 02:28 PM
I don't know then, i looked at the wiki and your relevance was fine ^_^
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