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: WTH? Character = Nil?

Previous Thread :: Next Thread 
axelvts is not online. axelvts
Joined: 27 Apr 2008
Total Posts: 3029
20 Apr 2015 04:38 PM
"Workspace.Animation Handler (put in workspace):3: attempt to index field 'Character' (a nil value)"

Was in my output...

----------------------------------------

This is the script:

function onPlayerRespawned(newPlayer)
while true do
if newPlayer.Character:findFirstChild("Animate")~=nil then break end
wait()
end
newPlayer.Character.Animate.Disabled = true
local c = script.Anima:Clone()
c.Parent = newPlayer.Character
c.Disabled = false
end

function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end

game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
20 Apr 2015 04:39 PM
wait(1) at the top

God grant me the wisdom to not punch stupid ppl, for I know I will go to prison.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
20 Apr 2015 04:43 PM
Use CharacterAdded.
Report Abuse
axelvts is not online. axelvts
Joined: 27 Apr 2008
Total Posts: 3029
20 Apr 2015 04:49 PM
Well, that output doesn't come up, but the script still doesn't work.

---

BTW, if I'm using a custom character, does it still use "Character?"

Because according to the Roblox lua site, the desc. of Character is:

"A model containing the humanoid, arms, legs, torso, and scripts of a player's character."

So if there is no parts named arms or legs, is it automatically not a Character?
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
20 Apr 2015 04:51 PM
I have a problem like this as well!
I always says my guy is nil....
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
20 Apr 2015 04:54 PM
Bump
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
20 Apr 2015 05:12 PM
do wat i said or get BSoD

God grant me the wisdom to not punch stupid ppl, for I know I will go to prison.
Report Abuse
axelvts is not online. axelvts
Joined: 27 Apr 2008
Total Posts: 3029
20 Apr 2015 05:27 PM
I did do what you said.
It got rid of the output, but the script still does nothing...
Report Abuse
axelvts is not online. axelvts
Joined: 27 Apr 2008
Total Posts: 3029
20 Apr 2015 05:28 PM
Also, what does BSoD mean???
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
20 Apr 2015 05:29 PM
game.Players.PlayerAdded:connect(function(player)
--do stuff to player
player.CharacterAdded:connect(function(char)
--do stuff to character
end)
end)
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
20 Apr 2015 05:29 PM
yea, what DOES bsoddodododdodo mean
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
20 Apr 2015 05:29 PM
Blue skreen of deth
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
20 Apr 2015 05:34 PM
o. gg.
Report Abuse
xman262 is not online. xman262
Joined: 24 Aug 2010
Total Posts: 19094
20 Apr 2015 05:36 PM
Hey how do you type the squiggly line on the keyboard?


Lord Of The Epic Face R$526/R$10,000
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
20 Apr 2015 05:36 PM
Axe, I just solved my problem by doing the following:
1. Make a new script and put it in StarterPack or StarterGui
2. Copy and paste everything you have in onPlayerRespawned
AKA:
while true do
if newPlayer.Character:findFirstChild("Animate")~=nil then break end
wait()
end
newPlayer.Character.Animate.Disabled = true
local c = script.Anima:Clone()
c.Parent = newPlayer.Character
c.Disabled = false

3. Paste it in the script
4. Copy Anima and put it in the new script
5. Bewm it works
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
20 Apr 2015 05:37 PM
Or you can use CharacterAdded
Report Abuse
axelvts is not online. axelvts
Joined: 27 Apr 2008
Total Posts: 3029
20 Apr 2015 05:56 PM
TrainingToTroll, I tried doing something like that and I don't think I understood properly/ I can't fix the script errors... Mind making a model for me?
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
20 Apr 2015 06:20 PM
k hold on
Report Abuse
TrainingToTroll is not online. TrainingToTroll
Joined: 27 Oct 2012
Total Posts: 1757
20 Apr 2015 06:24 PM
Wait, are you trying to make a new animation? I already have something for that.
Report Abuse
axelvts is not online. axelvts
Joined: 27 Apr 2008
Total Posts: 3029
20 Apr 2015 08:19 PM
Erm... An animation rig... Yes?
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