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
 

Re: I need help this script isn't working

Previous Thread :: Next Thread 
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
11 Aug 2013 09:46 AM
while wait() do
for i, c in pairs(Game.Players) do
local f = c.Character.Head.face
if f ~= nil then
f:destroy()
end
end
end
Report Abuse
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
11 Aug 2013 09:51 AM
Help?
Report Abuse
ekogame1720 is not online. ekogame1720
Joined: 25 Mar 2011
Total Posts: 335
11 Aug 2013 09:51 AM
What's the output?
Report Abuse
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
11 Aug 2013 09:53 AM
Output? I'm new to scripting really, this guy gave me this script and it doesn't work so idk.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
11 Aug 2013 09:54 AM
THIS IS YOUR SCRIPT -

while wait() do
for i, c in pairs(Game.Players) do
local f = c.Character.Head.face
if f ~= nil then
f:destroy()
end
end
end

Errors -
A. for i, c in pairs(Game.Players) do
It should be for i,c in pairs(game.Players:GetChildren()) do

B. local f = c.Character.Head.face
if f ~= nil then

It really doesn't work like that. It should be:
local f = c.Character.Head:FindFirstChild("face") if f then

This is the finished product -

while wait() do
for i, c in pairs(Game.Players:GetChildren()) do
local f = c.Character.Head:FindFirstChild("face")
if f then
f:destroy()
end
end
end
Report Abuse
ekogame1720 is not online. ekogame1720
Joined: 25 Mar 2011
Total Posts: 335
11 Aug 2013 09:57 AM
I didn't know you could combine the GetChildren() with the in pairs(). :3
Report Abuse
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
11 Aug 2013 09:57 AM
Thank you Be
Report Abuse
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
11 Aug 2013 09:57 AM
Wil lsomeone help me test it? Follow me?
Report Abuse
ekogame1720 is not online. ekogame1720
Joined: 25 Mar 2011
Total Posts: 335
11 Aug 2013 09:58 AM
Well there's an egg over my head, and I'm shy to remove it, so... c:
Report Abuse
thecoolskylar is not online. thecoolskylar
Joined: 28 Jul 2011
Total Posts: 1263
11 Aug 2013 09:59 AM
qq
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
11 Aug 2013 10:03 AM
"It really doesn't work like that."

Yes it does.

And use GetPlayers instead
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