ZDude2461
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 347 |
|
|
| 31 Dec 2012 09:52 AM |
local window = false local oldkos = script.Parent.Value script.Parent.Changed:connect(function() if script.Parent.Value > oldkos then if window == true then print("Doublekill") oldkos = kos.Value else window = true oldkos = kos.Value wait(1) window = false end end end)
--
Blurg. I've been playing around trying to make something that prints and output of "Doublekill" if you get more than two kills in less than a second.
This script was in the KOs value in the leaderstats, but that should change once I'm done with it.
I can't see anything wrong with it, but it doesn't return anything.
Help would be appreciated. |
|
|
| Report Abuse |
|
|
ZDude2461
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 347 |
|
|
| 31 Dec 2012 09:53 AM |
| If you get two kills in less than a second*, sorry. |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2012 10:13 AM |
1. This has to be LocalScript to work in the player. 2. It could be a regular script but needs to exist in PlayerGui, or StarterGear/Backpack.
|
|
|
| Report Abuse |
|
|
|
| 31 Dec 2012 10:15 AM |
That should work. You said you put the script into the KOs value? Try moving it elsewhere. |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 31 Dec 2012 10:33 AM |
local window = false local oldkos = script.Parent.Value script.Parent.Changed:connect(function() coroutine.resume(coroutine.create(function() if script.Parent.Value > oldkos then if window == true then print("Doublekill") oldkos = kos.Value else window = true oldkos = kos.Value wait(1) window = false end end end)) end) |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2012 10:48 AM |
Coroutines are not required...
- thedestroyer115 |
|
|
| Report Abuse |
|
|