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: Help on basic Double Kill script?

Previous Thread :: Next Thread 
ZDude2461 is not online. 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 is not online. 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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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 is not online. 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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
31 Dec 2012 10:48 AM
Coroutines are not required...

- thedestroyer115
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