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 » Scripting Helpers
Home Search
 

Help with the following script...

Previous Thread :: Next Thread 
Zarteon is not online. Zarteon
Joined: 25 Apr 2011
Total Posts: 2085
01 Dec 2012 12:34 PM
function onPlayerRespawned(newPlayer)
wait(5)

local Character = newPlayer.Character

if Character.Torso ~= nil then
Character.Torso.Transparency = 1
end
if Character.Head ~= nil then
Character.Head.Transparency = 1
end
if Character.Head.face.Texture ~= nil then
Character.Head.face.Texture = ""
end
if Character:findFirstChild("Right Leg") ~= nil then
Character:findFirstChild("Right Leg").Transparency = 1
end
if Character:findFirstChild("Left Leg") ~= nil then
Character:findFirstChild("Left Leg").Transparency = 1
end
if Character:findFirstChild("Right Arm") ~= nil then
Character:findFirstChild("Right Arm").Transparency = 1
end
if Character:findFirstChild("Left Arm") ~= nil then
Character:findFirstChild("Left Arm").Transparency = 1
end

local x = Character:GetChildren()
for i=1, #x do
if x[i].className == "Hat" then
x[i]:Remove()
end
end

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

game.Players.ChildAdded:connect(onPlayerEntered)


That is the script... The problem is it keeps outputting the following "Attempt to call a nill value"
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
01 Dec 2012 12:39 PM
Please do not make a new thread because your other one didn't get another reply, yet.
Also, stop bumping so often. Your thread didn't really hit the second page, yet.

The last one you tried, the one made by thedestroyer115. Use that script.
However, you need to change one of his lines..

Change
x[i]:Remove()
to
y[x]:Destroy()
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
01 Dec 2012 12:40 PM
Let me clarify..

Change

local y = Character.Head:GetChildren()
for x=1, #y do
if y[x].className == "Sound" then
x[i]:Remove()
end
end
end

to

local y = Character.Head:GetChildren()
for x=1, #y do
if y[x].className == "Sound" then
y[x]:Destroy()
end
end
end
Report Abuse
Zarteon is not online. Zarteon
Joined: 25 Apr 2011
Total Posts: 2085
01 Dec 2012 12:49 PM
Thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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