Perci1
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 1027 |
|
|
| 25 Apr 2014 04:56 PM |
The script is local.
local tool = script.Parent local hum = game.Players.LocalPlayer.Character.Humanoid
tool.Equipped:connect(function(mouse) mouse.Button1Down:connect(function() ani = Instance.new("Animation") ani.AnimationId = "http://www.roblox.com/Asset?ID=154838001" local aniTrack = hum:LoadAnimation(ani) aniTrack:Play() end) end)
The output says that Character is nil. I don't understand it.
|
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 05:03 PM |
| I think you need to give the animation a parent. |
|
|
| Report Abuse |
|
|
Perci1
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 1027 |
|
|
| 25 Apr 2014 05:06 PM |
What should be its parent? Humanoid?
That doesn't explain why it says Character is nil, though. |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 05:07 PM |
repeat wait() until game.Players.LocalPlayer.Character~=nil local hum = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
|
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 05:11 PM |
I just did some testing you need to put this line of code in at the top game.Workspace:WaitForChild(game.Players.LocalPlayer.Name) |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 05:17 PM |
Do what islandmaker2012 said.
LocalScripts usually are executed before the Character is loaded. Therefore, you need to wait for the Character to exist first before trying to reference to it. I do basically the same thing islandmaker2012 said, but like this:
while (not player.Character) do Wait() end |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 05:18 PM |
| All 3 of the post are solutions any one will work... |
|
|
| Report Abuse |
|
|
Perci1
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 1027 |
|
| |
|
|
| 25 Apr 2014 05:20 PM |
wait a second CRAZYMAN32!!!!!!!!!! WOW Would you mind looking at one of my post that needs help? |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 05:29 PM |
Its just another person helping. -_-
At the top of your script add
repeat wait() until game.Players.LocalPlayer
Dont check for the character. |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 05:55 PM |
| do check for the character,the character can take up to 6 seconds to load after the player enters.. |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2014 06:10 PM |
| Lol... I wish crazyman32 would reply to mine too :) |
|
|
| Report Abuse |
|
|