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: A Little Help

Previous Thread :: Next Thread 
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
22 Aug 2011 08:16 PM
Just a Little Help Needed(Ok Maybe i lied But IDK).Anyways How Could I convert This into the Killing and getting money and Xp When killing another Humanoid?Please Help,I know very Little scripting.

statsTable = {"Rank","Xp","Robux"}

function Leaderstats(Player)
local LsA = Instance.new("IntValue",Player)
LsA.Name = "leaderstats"
for i = 1, #statsTable do
local x = Instance.new("IntValue",LsA)
x.Name = statsTable[i]
end
end

game.Players.PlayerAdded:connect(Leaderstats)


~WildcatNation
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
22 Aug 2011 09:35 PM
statsTable = {"Rank","Xp","Robux"}

function Leaderstats(Player)
Player.CharacterAdded:wait()
local LsA = Instance.new("IntValue",Player)
LsA.Name = "leaderstats"
for i = 1, #statsTable do
Instance.new("IntValue",LsA).Name = statsTable[i]
end
local h = Player.Character:FindFirstChild("Humanoid")
while not h do wait() end
h.Died:connect(function()
local s = h:FindFirstChild("creator")
if s then
pcall(function()
s.leaderstats.STATYOUWANTTOCHANGE.Value = s.leaderstats.STATYOUWANTTOCHANGE.Value + 1
end)
end
end)
end

game.Players.PlayerAdded:connect(Leaderstats)
Report Abuse
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
23 Aug 2011 04:57 PM
Cool, Thanks dude,I owe you one.
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
23 Aug 2011 07:49 PM
Oops it is wrong o.e

Change:
s.leaderstats.STATYOUWANTTOCHANGE.Value = s.leaderstats.STATYOUWANTTOCHANGE.Value + 1
To:
s.Value.leaderstats.STATYOUWANTTOCHANGE.Value = s.Value.leaderstats.STATYOUWANTTOCHANGE.Value + 1
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