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 » Scripters
Home Search
 

Re: Help with script logic?

Previous Thread :: Next Thread 
fireflame09225 is not online. fireflame09225
Joined: 04 Jan 2010
Total Posts: 1818
03 Jan 2017 08:30 PM
I'm making a wanted system similar to that found in GTA and I've hit a snag in the script logic.

When a player kills someone, their recent_kills increases. And when it reaches a certain point their wanted_level goes up. I've got the basics set up, but I need to make a timer that detects when the last time the player killed was. That's the problem.

I need to use the Changed event to also reset the timer...

But if a player kills 2 people in a row, the event will be called twice, and two separate timers will be going?

Idk I'm just confusing myself at this point.
Report Abuse
EnixSquare is not online. EnixSquare
Joined: 22 Dec 2010
Total Posts: 82
03 Jan 2017 08:42 PM
You can use tick to make this easier.

http://wiki.roblox.com/index.php?title=Global_namespace/Functions_specific_to_ROBLOX&redirect=no#tick


Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
03 Jan 2017 08:43 PM
^ tick wouldn't make it easier at all
Report Abuse
fireflame09225 is not online. fireflame09225
Joined: 04 Jan 2010
Total Posts: 1818
03 Jan 2017 09:11 PM
Ahhhh, that might actually help, thank you.
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
03 Jan 2017 09:13 PM
tick wouldn't make it easier at all [2]


#code DOCTYPE! html >html< >header< >body< >p< HTML is Hyper Text Markup Language >/p< >/body< >/header< >/html<
Report Abuse
fireflame09225 is not online. fireflame09225
Joined: 04 Jan 2010
Total Posts: 1818
03 Jan 2017 09:14 PM
How wouldn't it? Is there an easier way?
Report Abuse
fireflame09225 is not online. fireflame09225
Joined: 04 Jan 2010
Total Posts: 1818
04 Jan 2017 10:34 AM
bump
Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
04 Jan 2017 10:36 AM
whenever they kill someone just do

kills = (kills + 1)
wait(3)
kills = (kills - 1)
Report Abuse
fireflame09225 is not online. fireflame09225
Joined: 04 Jan 2010
Total Posts: 1818
04 Jan 2017 10:46 AM
Can't do that. Because I need it based on how LONG it's been since they've killed someone. If they kill someone I need to reset the timer on how long it's been.

And doing that would fire the Changed event again, so there would be two changed events going at once, then three, and so on.
Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
04 Jan 2017 10:48 AM
what I posted can do that

if they kill 2 people within 3 seconds of each other, kills will be 2
Report Abuse
pepestan is not online. pepestan
Joined: 05 Jul 2011
Total Posts: 515
04 Jan 2017 10:56 AM
One way:



Timer = 0

while wait(1) do
Timer = Timer + 1
end



There's a timer lol
Set Timer to 0 when player is killed.


~Thanks, Pepe
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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