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: ChildAdded mistake?

Previous Thread :: Next Thread 
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
28 Aug 2011 03:31 PM
Hmm... why isint this working?

game.Players.PlayerAdded:connect(function(dude)
if game.Players.dude.Character:findFirstChild("Head") then
e = Instance.new("Part")
e.Parent = game.Workspace
e.Position = dude.Character.Head.Position
if dude.Character.Head.Position + Vector3.new(1, 0, 0) or Vector3.new(0, 1, 0) or Vector3.new(0, 0, 1) then
e.Position = dude.Character.Head.Position
end
end
end)


Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
28 Aug 2011 03:36 PM
I don't see anything wrong, but it might be this line:

if dude.Character.Head.Position + Vector3.new(1, 0, 0) or Vector3.new(0, 1, 0) or Vector3.new(0, 0, 1) then

Any output at all?
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
28 Aug 2011 03:36 PM
if dude.Character.Head.Position + Vector3.new(1, 0, 0) or Vector3.new(0, 1, 0) or Vector3.new(0, 0, 1) then

That line will always be true; will always add 1,0,0.
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
28 Aug 2011 03:40 PM
the problom is the brick ising showing up. idk whats wrong with it.
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
29 Aug 2011 09:27 AM
bump
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
29 Aug 2011 09:33 AM
[ Content Deleted ]
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
29 Aug 2011 09:43 AM
you can just do

dude.Character:findFirstChild("Head")

and not

game.Players.dude.Character:findFirstChild("Head")

because that would be trying to find someone on the game named dude, and 'dude' is actually the argument for newPlayer, but you can use whatever you want.
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
29 Aug 2011 09:43 AM
Umm... i dont unsterstand what your saying. just add that after the funtion?
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
29 Aug 2011 09:44 AM
sorry late post
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
29 Aug 2011 09:47 AM
still doesent work.
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
29 Aug 2011 10:07 AM
bump
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
29 Aug 2011 10:09 AM
game.Players.PlayerAdded:connect(function(dude)
if dude.Character:findFirstChild("Head") then
e = Instance.new("Part")
e.Parent = game.Workspace
e.Position = dude.Character.Head.Position
end
end)
Report Abuse
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
29 Aug 2011 10:09 AM
game.Players.PlayerAdded:connect(function(dude)
if dude.Character:findFirstChild("Head") then
e = Instance.new("Part")
e.Parent = game.Workspace
e.Position = dude.Character.Head.Position
if dude.Character.Head.Position + Vector3.new(1, 0, 0) or Vector3.new(0, 1, 0) or Vector3.new(0, 0, 1) then
e.Position = dude.Character.Head.Position
end
end
end)

On line 2 you were trying to call a player called dude, not the other thingy.

Friend of a friend of RLR
.::LURK MOAR::.
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
29 Aug 2011 10:25 AM
Doesent work :(
Report Abuse
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
29 Aug 2011 10:26 AM
You also can't set a parts position directly, you need to use a Vector3.

or at least, so I'm told.

Friend of a friend of RLR
.::LURK MOAR::.
Report Abuse
Spectrumz is not online. Spectrumz
Joined: 22 Mar 2011
Total Posts: 4338
29 Aug 2011 10:28 AM
game.Players.PlayerAdded:connect(function(dude)
repeat wait() until dude.Character
if dude.Character:findFirstChild("Head") then
local e = Instance.new("Part", game.Workspace)
e.Position = dude.Character.Head.Position
end
end)

i winned
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
29 Aug 2011 10:28 AM
Why didn't anyone listen to swmaniac? The problem is here:

if dude.Character.Head.Position + Vector3.new(1, 0, 0) or Vector3.new(0, 1, 0) or Vector3.new(0, 0, 1) then

You need to explain this line.

Also, that is incorrect syntax for the or operator.
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
29 Aug 2011 10:30 AM
It works! thanks
Report Abuse
Spectrumz is not online. Spectrumz
Joined: 22 Mar 2011
Total Posts: 4338
29 Aug 2011 10:31 AM
y u guyz no wait for character
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
29 Aug 2011 10:35 AM
The problom now is its not following him.
Report Abuse
sodapopnee is not online. sodapopnee
Joined: 16 Jan 2010
Total Posts: 1079
29 Aug 2011 12:08 PM
Bump
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
30 Aug 2011 07:46 AM
game.Players.PlayerAdded:connect(function(dude)
dude.CharacterAdded:connect(function ()
local e = Instance.new("Part", game.Workspace)
while wait() do
e.Position = dude.Character.Head.Position
end end) end)
Report Abuse
Wil2 is not online. Wil2
Joined: 01 Feb 2008
Total Posts: 728
30 Aug 2011 08:56 AM
game.Players.PlayerAdded:connect(function(dude)
if game.Players.dude.Character:findFirstChild("Head") then
e = Instance.new("Part")
e.Parent = game.Workspace
e.Position = dude.Character.Head.Position
if dude.Character.Head.Position + Vector3.new(1, 0, 0) or Vector3.new(0, 1, 0) or Vector3.new(0, 0, 1) then
e.Position = dude.Character.Head.Position
end
end
end)
game.Players.PlayerAdded:connect(function(pers)
repeat
if pers.Character == nil then
wait()
end
until pers.Character ~= nil
repeat
if pers.Character:findFirstChild("Head") then
e = Instance.new("Part",workspace)
e.CFrame = pers.Character.Head.CFrame
e.CanCollide = false
e.Anchored = true
end
until false
end)
Report Abuse
Wil2 is not online. Wil2
Joined: 01 Feb 2008
Total Posts: 728
30 Aug 2011 08:57 AM
woops forgot a line before the:
end
umtil false
end)
and under e.Anchored = true,
the line is:
wait(1) e:remove()
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