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: add current intvalue to walkspeed?

Previous Thread :: Next Thread 
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 07:31 AM
I got a datastore leaderstat with child of agility and i want to add the current agility value to player walkspeed, but it doesn't work.


This is a seprate script from the datastore script

local character = game.Players.LocalPlayer.Character
local player = game.Players.LocalPlayer
local agi = player.leaderstats.Agility


character.Humanoid.WalkSpeed = character.Humanoid.WalkSpeed +agi.Value

Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 07:31 AM
The agility is an IntValue
Report Abuse
edenDeden is not online. edenDeden
Joined: 29 Jul 2016
Total Posts: 370
14 Feb 2017 07:37 AM
u have to have an event like when player is dieing so the walkspeed will be changed
becuse this will work only for one time (iam not even sure about that) but yeah make sure its a local script as well


Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 07:40 AM
My script doesn't give error... it just doesn't change the walkspeed... but whenever i do +1 instead of the agi.value it works..
Report Abuse
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
14 Feb 2017 07:44 AM
is agi.Value > 0?

NOW GATHER, UNDER THE NAME OF TEAM ROCKET!
Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 07:46 AM
and ### it's localscript
Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 07:47 AM
its value is 5
Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 07:48 AM
whhy u ask
Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 07:48 AM
is it # problem does wakspeed have max cause i trid changing the walkspeed to 3000 and it still works...
Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 07:51 AM
the intvalue is an instance but i dont think it's a problem..........
Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 07:53 AM
THIS ISS DRIVING ME CRAZY WHAT IM DOING WONG
Report Abuse
Berberoka is not online. Berberoka
Joined: 21 Apr 2011
Total Posts: 328
14 Feb 2017 08:02 AM
This happens if you don't wait for the data to be loaded. What you need to do is wait for the data to be fully loaded before adding the value to the player walkspeed.

Or you could just add wait() to your script.
Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 08:04 AM
IT WORKIN NOW THANKS
Report Abuse
npott13 is not online. npott13
Joined: 19 Dec 2010
Total Posts: 264
14 Feb 2017 08:16 AM
now its say that character is nil value??????????????????????????????????????
Report Abuse
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
14 Feb 2017 09:39 AM
you're trying to get character before it's loaded, this should work

local player = game.Players.LocalPlayer

player.CharacterAdded:connect(function(character)
local agi = player.leaderstats.Agility
character.Humanoid.WalkSpeed = character.Humanoid.WalkSpeed + agi.Value
end)

NOW GATHER, UNDER THE NAME OF TEAM ROCKET!
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