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: Problem!?!?!?

Previous Thread :: Next Thread 
myrobloxman is not online. myrobloxman
Joined: 06 Dec 2009
Total Posts: 1369
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
myrobloxman is not online. myrobloxman
Joined: 06 Dec 2009
Total Posts: 1369
22 Jun 2011 03:18 PM
HEY!

yeah you!


I need your help!
Report Abuse
Friaza is not online. Friaza
Joined: 26 Dec 2008
Total Posts: 6229
22 Jun 2011 03:21 PM
Player = ?
Report Abuse
myrobloxman is not online. myrobloxman
Joined: 06 Dec 2009
Total Posts: 1369
22 Jun 2011 03:23 PM
"player = game.Workspace:findFirstChild("Player")"

line 17
Report Abuse
myrobloxman is not online. myrobloxman
Joined: 06 Dec 2009
Total Posts: 1369
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 is not online. 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
myrobloxman is not online. myrobloxman
Joined: 06 Dec 2009
Total Posts: 1369
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
myrobloxman is not online. myrobloxman
Joined: 06 Dec 2009
Total Posts: 1369
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 is not online. 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
LordProxius is not online. LordProxius
Joined: 04 May 2008
Total Posts: 79
10 Jun 2014 05:56 AM
Too bad this post is over 2 years old
Report Abuse
drickard1 is not online. drickard1
Joined: 12 Jul 2009
Total Posts: 74
11 Jun 2014 03:46 PM
Yep.
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