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 » Scripters
Home Search
 

Re: How do i call upon a created "Leaderstat"

Previous Thread :: Next Thread 
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:04 AM
I have an rpg leaderstat board and they consist of the following elements
(in order)
xp
lvl
Money
Str
Agi

these elements are adjusted by the "rpg leaderboard script"
I want to know how i can call on the designated player stats and adjust them to my "humanoid stats"
the damage of my blade to my "str" on the leaderboard
and the speed of my walking according to the "agi" on the leaderboard.

I had an idea to put it in the blade, this is what i got, and it doesnt work, Can someone help me?



local tool = script.Parent
local level = 100
local player = tool.Parent.Humanoid
if player == nil then
print("No Humanoid")
return
end
local walkspeed = player.WalkSpeed
player.WalkSpeed = walkspeed+(9+level)

local damage = player.stats.Str +500
local slash_damage = player.stats.Str + 700


Do i have to call upon leaderstats from the designated humanoid, such at this? or is there a way i can put into my "rpg leaderstats" script to enable the adjustment of the Damage of my character to the speed of my character to the designated skill level value of the agility and str on the leaderboard?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
04 Dec 2014 11:11 AM
I think your stat handling is funny.
But yes, you'd have to access it from the player like that
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:12 AM
O.o I dont understand, this does not work, it does absolutely no damage to the npc humanoids, its like the source is nil
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:13 AM
also i dont even walk faster, its lame. my walkspeed is supposed to be over 100 according to this script, walks normal speed. this script has been placed "inside the tool of the "blade" "
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
04 Dec 2014 11:15 AM
leaderstats will be in

game.Players:GetPlayerFromCharacter(player).leaderstats
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:16 AM
this is the function that rules the stat changed on lvl up, i want the damage to be added and the walkspeed to be added, this function is in the "Leaderboard"
can you help me change this?


function onXPChanged(player, xp, level, c, Strength, Agility)
if xp.Value>=level.Value * 80 then
xp.Value = xp.Value * 0
level.Value = level.Value + 1
c.Value = c.Value + 500
Strength.Value = Strength.Value + 1
Agility.Value = Agility.Value + 1
end
end



where Agi and str are, i want them to change damage and agility stats, so far they just change the "leaderstat value"
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
04 Dec 2014 11:17 AM
Dude, something tells me you have no idea what you're doing.
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:20 AM
well yeah thats why i posted here man, thats why you gotta help me, So another question, How do i connect the leaderstat values str and agi to the walkspeed of my humanoid and the damage of my humanoid?
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:22 AM
so...?
game.Players:GetPlayerFromCharacter(player).leaderstats.agi
leaderstats.Agi = humanoid.WalkSpeed
???
???
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
04 Dec 2014 11:23 AM
Connect the changed events of the Agi and Str values to the base mods (Walkspeed, stuff) and then check the values on instance events (Attacking, getting damaged, etc.)
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:32 AM
so would this be correct?

local player = game.Players:GetPlayerFromCharacter(player).leaderstats
local Agi = game.Players:GetPlayerFromCharacter(player).leaderstats.Agi
Local Str = game.Players:GetPlayerFromCharacter(player).leaderstats.Str
local WalkSpeed = game.Players:GetPlayerFromCharacter(player).Humanoid.Walkspeed


local Damage = Str.+10
local slash_damage = Str.10
local walkspeed = Agi + Walkspeed

???
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:38 AM
local player = game.Players:GetPlayerFromCharacter(player).leaderstats
local Agi = game.Players:GetPlayerFromCharacter(player).leaderstats.Agi
Local Str = game.Players:GetPlayerFromCharacter(player).leaderstats.Str
local WalkSpeed = game.Players:GetPlayerFromCharacter(player).Humanoid.Walkspeed


local Damage = Str.+10
local slash_damage = player.Str.10
local walkspeed = player.Agi + player.Walkspeed



Maybe even this? im not sure?
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:43 AM
I tried this one exactly, in sword, and did not work


local player = game.Players:GetPlayerFromCharacter(player).leaderstats
local Agi = game.Players:GetPlayerFromCharacter(player).leaderstats.Agi
local Str = game.Players:GetPlayerFromCharacter(player).leaderstats.Str
local WalkSpeed = game.Players:GetPlayerFromCharacter(player).Humanoid.WalkSpeed


local damage = Str + 10
local slash_damage = player.Str + 10
local walkspeed = player.Agi + player.WalkSpeed
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
04 Dec 2014 11:47 AM
player = game.Players:GetPlayerFromCharacter(player).leaderstats

Mkay great was that the whole thing because you forgot to define player
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 11:56 AM
so this is exactly what i have put in the sword, But it did not work ;(



local player = game.Players:GetPlayerFromCharacter(player).leaderstats
local Agi = game.Players:GetPlayerFromCharacter(player).leaderstats.Agi
local Str = game.Players:GetPlayerFromCharacter(player).leaderstats.Str
local WalkSpeed = game.Players:GetPlayerFromCharacter(player).Humanoid.WalkSpeed

local damage = player.Str + 10
local slash_damage = player.Str + 10
local walkspeed = player.Agi + player.WalkSpeed



since on the leaderboard, my stats are called like this???
(player, xp, level, c, Strength, Agility)
is it possible that the commands also need to be called in this order?

Example:



local walkspeed = player.xp.level.money.strength.agility +10
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
04 Dec 2014 11:58 AM
local player = game.Players:GetPlayerFromCharacter(player).leaderstats
local Agi = game.Players:GetPlayerFromCharacter(player).leaderstats.Agi
local Str = game.Players:GetPlayerFromCharacter(player).leaderstats.Str
local WalkSpeed = game.Players:GetPlayerFromCharacter(player).Humanoid.WalkSpeed

NO NO NO NO NO L34RN TO LU4 OR G3T OUT STOP ST1CK1NG STUFF TOG3TH3R 4ND HOP1NG 1T W1LL JUST -WORK-
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
04 Dec 2014 12:00 PM
Add .Value
...Agi.Value
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 12:05 PM
there is a word .add?!?!?!? COMMAND!?!??
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 12:06 PM
Can you explain to me what you mean?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
04 Dec 2014 12:08 PM
You can't get a player from nil
You can't get a player from leaderstats
You can't get a value type Instance's value by just referencing the Instance.
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 12:10 PM
ok, so, how do i reference this to fix my problem?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
04 Dec 2014 12:11 PM
Stop being silly.
Go look on the Wiki at how the things I told you about work.
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 12:12 PM
can i use this rpg script on the board to find the value of the player to change the humanoid stats?




function onXPChanged(player, xp, level, c, Strength, Agility)
if xp.Value>=level.Value * 80 then
xp.Value = xp.Value * 0
level.Value = level.Value + 1
c.Value = c.Value + 500
Strength.Value = Strength.Value + 1
Agility.Value = Agility.Value + 1
end
end

this section knows what player is being "lvled up" can i post my values here and it will change the generality of the walkspeed and the damage?
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 12:15 PM
also how do i put the damage over teh swords damage?
is there a general damage that the humanoid that is the "playing character" has or is it all through just the blade? and if it is from the blade, How do i call upon that source to enact damage change regularly?
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
04 Dec 2014 12:28 PM
or are you talking about this?


do
local player = game.Players:GetPlayerFromCharacter(player).leaderstats
local Agi = game.Players:GetPlayerFromCharacter(player).leaderstats.Agi
local Str = game.Players:GetPlayerFromCharacter(player).leaderstats.Str
local WalkSpeed = game.Players:GetPlayerFromCharacter(player).Humanoid.WalkSpeed


end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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