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: EASY! PLEASE HELP!

Previous Thread :: Next Thread 
maxter480 is not online. maxter480
Joined: 17 Jan 2008
Total Posts: 102
19 Sep 2011 05:36 PM
DO NOT RESPOND IF YOU ARENT GOING TO HELP. THIS IS A COMMONLY USED FUCTION IN A LOT OF GAMES BUT I NEED HELP. IT DOESNT SAY ANYTHING ON THE WIKI THAT HELPS.


So I have a script in my zombie with a Humanoid called Humanoid, but when I kill it, the leaderstats don't increase

The script that is in the zombie is:

Stat2 = True --Make this either true or false depending if you want something else to go be increased in leaderstats.

StatName = "Points" --Name of stats.

IncreaseValue = 100

Stat2Name = "Kills" --SecondStat name

IncreaseValue2 = 1

local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats[StatName].Value = Leaderstats[StatName].Value + IncreaseValue
if Stat2 == true then
Leaderstats[Stat2Name].Value = Leaderstats[Stat2Name].Value + IncreaseValue2
wait(0.1)
script:remove()
end
end
end
end
end
Humanoid.Died:connect(PwntX_X)
Report Abuse
italius is not online. italius
Joined: 14 Sep 2011
Total Posts: 3560
19 Sep 2011 05:37 PM
DO NOT RESPOND IF YOU ARENT GOING TO HELP. THIS IS A COMMONLY USED FUCTION IN A LOT OF GAMES BUT I NEED HELP. IT DOESNT SAY ANYTHING ON THE WIKI THAT HELPS.


So I have a script in my zombie with a Humanoid called Humanoid, but when I kill it, the leaderstats don't increase

The script that is in the zombie is:

Stat2 = True --Make this either true or false depending if you want something else to go be increased in leaderstats.

StatName = "Points" --Name of stats.

IncreaseValue = 100

Stat2Name = "Kills" --SecondStat name

IncreaseValue2 = 1

local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats[StatName].Value = Leaderstats[StatName].Value + IncreaseValue
if Stat2 == true then
Leaderstats[Stat2Name].Value = Leaderstats[Stat2Name].Value + IncreaseValue2
wait(0.1)
script:remove()
end
end
end
end
end
Humanoid.Died:connect(PwntX_X)
end

Please buy this, I have 62 robux.. http://www.roblox.com/Donation-shirt-item?id=61817801
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
19 Sep 2011 05:39 PM
'True' is not capitalized in Lua. If the script STILL doesn't work after you change the case of True, your WEAPON does not put a creator tag in the humanoid when it damages your zombie.
Report Abuse
maxter480 is not online. maxter480
Joined: 17 Jan 2008
Total Posts: 102
19 Sep 2011 07:19 PM
Thanks fire. My gun doesn't make the creatortag. Does that go in the projectile script or the reg. gun script? and what is the script to make a creator tag?
Report Abuse
maxter480 is not online. maxter480
Joined: 17 Jan 2008
Total Posts: 102
19 Sep 2011 07:22 PM
Nevermind, I found it on my own. Thanks a ton
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