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: Would this script work?

Previous Thread :: Next Thread 
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
22 Sep 2013 03:14 PM
game.Players.PlayerAdded:connect(function(player)
stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"
Kos = Instance.new("IntValue", stats)
Kos.Name = "Ko's"
Wos = Instance.new("IntValue", stats)
Wos.Name = "Wo's"
Wos.Value = 0
Kos.Value = 0
end)
function giveawipeout()
player = game.Players.Player:FindFirstChild("Humanoid")
if player.Humanoid.Health == nil then
Wos.Value = +1
end
end



giveawipeout()
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
22 Sep 2013 03:17 PM
Nope.

'player' is an argument of the first function, therefore it can't be used in any other functions.
However, you could do this:

game.Players.PlayerAdded:connect(function(player)
local stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"
local Kos = Instance.new("IntValue", stats)
Kos.Name = "Ko's"
local Wos = Instance.new("IntValue", stats)
Wos.Name = "Wo's"
player.Character["Humanoid"].Died:connect(function()
Wos.Value= Wos.Value + 1
end)
end)
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
22 Sep 2013 03:18 PM
I never knew there was a propertie .died.
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
22 Sep 2013 03:24 PM
Geo, that doesn't work.

Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
22 Sep 2013 03:43 PM
Halp!
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
22 Sep 2013 03:46 PM
Go play your game with that script then try it.
Report Abuse
ReplicatedStorage is not online. ReplicatedStorage
Joined: 21 Sep 2013
Total Posts: 19
22 Sep 2013 04:08 PM
[ Content Deleted ]
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