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
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 264 |
|
|
| 14 Feb 2017 07:31 AM |
| The agility is an IntValue |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 14 Feb 2017 07:44 AM |
is agi.Value > 0?
NOW GATHER, UNDER THE NAME OF TEAM ROCKET! |
|
|
| Report Abuse |
|
|
npott13
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 264 |
|
| |
|
npott13
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 264 |
|
| |
|
npott13
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 264 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 264 |
|
| |
|
npott13
|
  |
| Joined: 19 Dec 2010 |
| Total Posts: 264 |
|
|
| 14 Feb 2017 08:16 AM |
| now its say that character is nil value?????????????????????????????????????? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|