|
| 22 Jun 2011 03:07 PM |
I need this to not break when i die this is the output: Player we are here Wed Jun 22 14:06:17 2011 - Torso is not a valid member of Model Wed Jun 22 14:06:17 2011 - Workspace.Robot1Spawn.Security doors.Part.Script, line 21 stack end
code: local a = script.Parent.Position.X local b = script.Parent.Position.Y local c = script.Parent.Position.Z
repeat wait() until game.Workspace:findFirstChild("Player") local magnitude = (script.Parent.Position - game.Workspace.Player.Torso.Position).magnitude print(magnitude) --if game.Workspace:findFirstChild("Player") then --repeat wait() magnitude = (script.Parent.Position - game.Workspace.Player.Torso.Position).magnitude until magnitude < 10 --end while true do repeat wait() until game.Workspace:findFirstChild("Player") script.Parent.CFrame = CFrame.new(a, b, c) * CFrame.Angles(0, math.pi/2, 0) wait(.1) repeat wait() until game.Workspace:findFirstChild("Player") player = game.Workspace:findFirstChild("Player") print(player) if player ~= nil then print("we are here") repeat wait() until game.Workspace:findFirstChild("Player") magnitude = (script.Parent.Position - player.Torso.Position).magnitude --print(magnitude) else magnitude = 100 end if magnitude < 20 and b > -7 then b = b - .1 script.Parent.Parent.DoorsOpening.Value = false end if magnitude > 20 and b < 9.6 then b = b + .1 script.Parent.Parent.DoorsOpening.Value = false end if magnitude < 20 and b <= -7 then script.Parent.Parent.DoorsOpening.Value = true end end |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2011 03:18 PM |
HEY!
yeah you!
I need your help! |
|
|
| Report Abuse |
|
|
Friaza
|
  |
| Joined: 26 Dec 2008 |
| Total Posts: 6229 |
|
| |
|
|
| 22 Jun 2011 03:23 PM |
"player = game.Workspace:findFirstChild("Player")"
line 17 |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2011 03:34 PM |
hey guess what!! first thing I learned:
when you die your player model stays intact so waiting for the model does me no good!
second thing I learned none of you knew that! -.- |
|
|
| Report Abuse |
|
|
Friaza
|
  |
| Joined: 26 Dec 2008 |
| Total Posts: 6229 |
|
|
| 22 Jun 2011 03:36 PM |
| I forgot about this post sorry, and I don't like reading 100 line posts much... |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2011 03:40 PM |
I promise it is less than onehundred -.-
ok now i have a problem when I die it sticks somewhere? |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2011 03:48 PM |
*****FIXED*****
no thanks to you people....
local a = script.Parent.Position.X local b = script.Parent.Position.Y local player = nil local torso = nil local c = script.Parent.Position.Z
repeat wait() until game.Workspace:findFirstChild("Player") local magnitude = (script.Parent.Position - game.Workspace.Player.Torso.Position).magnitude print(magnitude) --if game.Workspace:findFirstChild("Player") then --repeat wait() magnitude = (script.Parent.Position - game.Workspace.Player.Torso.Position).magnitude until magnitude < 10 --end while true do repeat wait() until game.Workspace:findFirstChild("Player") script.Parent.CFrame = CFrame.new(a, b, c) * CFrame.Angles(0, math.pi/2, 0) wait(.1) repeat wait() until game.Workspace:findFirstChild("Player")
repeat wait() player = game.Workspace:findFirstChild("Player") until player:findFirstChild("Torso") torso = player:findFirstChild("Torso") print(player) if torso ~= nil then print("we are here") repeat wait() until game.Workspace.Player:findFirstChild("Torso") magnitude = (script.Parent.Position - player.Torso.Position).magnitude --print(magnitude) else magnitude = 100 end if magnitude < 20 and b > -7 then b = b - .1 script.Parent.Parent.DoorsOpening.Value = false end if magnitude > 20 and b < 9.6 then b = b + .1 script.Parent.Parent.DoorsOpening.Value = false end if magnitude < 20 and b <= -7 then script.Parent.Parent.DoorsOpening.Value = true end end |
|
|
| Report Abuse |
|
|
drickard1
|
  |
| Joined: 12 Jul 2009 |
| Total Posts: 74 |
|
|
| 08 Jun 2014 11:41 AM |
Lol... Don't be so mad. It only took you like 40 min to figure out the problem yourself... |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 05:56 AM |
Too bad this post is over 2 years old
|
|
|
| Report Abuse |
|
|
drickard1
|
  |
| Joined: 12 Jul 2009 |
| Total Posts: 74 |
|
| |
|