Data Realms Fan Forums http://45.55.195.193/ |
|
Noob Help http://45.55.195.193/viewtopic.php?f=73&t=12066 |
Page 1 of 1 |
Author: | FarvanTorna [ Sun Aug 24, 2008 3:07 pm ] |
Post subject: | Noob Help |
Trying to make it where if any actor has a Pistol in his held device it will fling him Code: for actor in MovableMan.Actors do if actors.HeldDevice("Pistol") then MovableMan.Actors do actors.Vel = Vector(3, -10) end end Keep getting a error of needs a = somewhere. kinda pieced this code together from differnt people on this forum(didn't work) |
Author: | Joudoki [ Sun Aug 24, 2008 3:10 pm ] |
Post subject: | Re: Noob Help |
Try this for actor in MovableMan.Actors do if actor.HeldDevice("Pistol") then actor.Vel = Vector(3, -10) end end |
Author: | FarvanTorna [ Sun Aug 24, 2008 3:19 pm ] |
Post subject: | Re: Noob Help |
I no longer get the error(thank you) but it cannot find helddevice recalls it as a nil |
Author: | NickFury666 [ Sun Aug 24, 2008 4:27 pm ] |
Post subject: | Re: Noob Help |
Pistol is an HDFirearm, not a HeldDevice, methinks. |
Author: | robowurmz [ Sun Aug 24, 2008 9:27 pm ] |
Post subject: | Re: Noob Help |
FarvanTorna wrote: Trying to make it where if any actor has a Pistol in his held device it will fling him Code: for actor in MovableMan.Actors do if actors.HeldDevice("Pistol") then MovableMan.Actors do actors.Vel = Vector(3, -10) end end Keep getting a error of needs a = somewhere. kinda pieced this code together from differnt people on this forum(didn't work) Needs to be this: Code: for actor in MovableMan.Actors do if (actors.HeldDevice =="Pistol") then MovableMan.Actors do actors.Vel = Vector(3, -10) end end You weren't checking to see if it was something or not: you were instead setting the variable to that. |
Author: | FarvanTorna [ Sun Aug 24, 2008 10:49 pm ] |
Post subject: | Re: Noob Help |
robowurmz wrote: FarvanTorna wrote: Trying to make it where if any actor has a Pistol in his held device it will fling him Code: for actor in MovableMan.Actors do if actors.HeldDevice("Pistol") then MovableMan.Actors do actors.Vel = Vector(3, -10) end end Keep getting a error of needs a = somewhere. kinda pieced this code together from differnt people on this forum(didn't work) Needs to be this: Code: for actor in MovableMan.Actors do if (actors.HeldDevice =="Pistol") then MovableMan.Actors do actors.Vel = Vector(3, -10) end end You weren't checking to see if it was something or not: you were instead setting the variable to that. not working.....ummm.... error unexpected symbol near "" also go an error right after that says expected = |
Author: | Grif [ Sun Aug 24, 2008 10:56 pm ] |
Post subject: | Re: Noob Help |
Code: for actor in MovableMan.Actors do if actors.HeldDevice == "Pistol" then MovableMan.Actors do actors.Vel = actor.Vel(3, -10); end end That should work. Maybe. |
Author: | Ophanim [ Sun Aug 24, 2008 10:57 pm ] |
Post subject: | Re: Noob Help |
Code: for actor in MovableMan.Actors do if (actors.HeldDevice == "Pistol") then MovableMan.Actors do actors.Vel = Vector(3, -10) end end |
Author: | casey [ Mon Aug 25, 2008 1:09 am ] |
Post subject: | Re: Noob Help |
vvv this works vvv Code: for a in MovableMan.Actors do if a.HDFirearm==Pistol then a.Vel=Vector(3, -10) end end I've removed this as part of my apology |
Author: | Daman [ Mon Aug 25, 2008 1:27 am ] |
Post subject: | Re: Noob Help |
casey wrote: nice try but all of those are wrong Code: for a in MovableMan.Actors do if a.HDFirearm==Pistol then a.Vel=Vector(3, -10) end end okay, heres what mistakes you made. pistol can't have () that's only for varibles. a or in your codes actor is just a new name for an item, it isn't special, and you sited a different variable "actors" which caused a (nil'). even then it only works for the instant that you press enter. for it to be ongoing you need to set up a timer & put the code into a notepad. im still learning about timers P.S. spaces arent read, they dont acctually matter It's funny how wrong your post is. What are you talking about pistol can't have () it's only for variables? () is for functions. It usually encases arguments. How the ♥♥♥♥ is that going to cause nil? Wrong again. An instant that he presses enter? Ongoing? What? Who mentioned that. Augh. This isn't working because the variable doesn't exist YOU GUYS. Oh and spaces do matter because Code: forainMovableMan.Actorsdoifa.HDFirearm==Pistolthena.Vel=Vector(3, -10)endend is not going to work. |
Author: | casey [ Mon Aug 25, 2008 8:06 pm ] |
Post subject: | Re: Noob Help |
fine, sorry i acted like an ♥♥♥hole can you forgive me? |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |