lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 24 Apr 2013 01:40 AM |
if game.Players.LocalPlayer.Character.Shirt ~= nil then game.Players.LocalPlayer.Character.Shirt:Destroy() end
02:37:42.648 - Shirt is not a valid member of Model 02:37:42.649 - Script "Workspace.Player1.Rotate", Line 16 02:37:42.650 - stack end
There's more to the script, but that's that part that fails. The rest of the script doesn't continue. The first line is number 16. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 24 Apr 2013 01:59 AM |
Entire script if matters:
wait(1) local target = game.Workspace.CameraScript.PosChecker local camera = game.Workspace.CurrentCamera local angle = 100 local char = game.Players.LocalPlayer.Character local LP = game.Workspace:findFirstChild("LoadingPlatform") slow,norm,fast = .6,1.2,1.8 custom = 2.4
camera.CameraType = "Scriptable" camera.CameraSubject = target LP = game.Workspace.LoadingPlatform game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0 game.Players.LocalPlayer.Character.Torso.CFrame = LP.CFrame
if game.Players.LocalPlayer.Character.Shirt ~= nil then game.Players.LocalPlayer.Character.Shirt:Destroy() end
if game.Players.LocalPlayer.Character.Pants ~= nil then game.Players.LocalPlayer.Character.Pants:Destroy() end
game.Players.LocalPlayer.Character["Body Colors"].LeftArm = BrickColor.new("Bright Yellow") game.Players.LocalPlayer.Character["Body Colors"].HeadColor = BrickColor.new("Bright Yellow") game.Players.LocalPlayer.Character["Body Colors"].LeftArm = BrickColor.new("Bright Yellow") game.Players.LocalPlayer.Character["Body Colors"].RightArm = BrickColor.new("Bright Yellow") game.Players.LocalPlayer.Character["Body Colors"].LeftLeg = BrickColor.new("Bright Yellow") game.Players.LocalPlayer.Character["Body Colors"].RightLeg = BrickColor.new("Bright Yellow")
while wait() do camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part * CFrame.Angles(0, math.rad(angle), 0) --Rotate by the angle * CFrame.new(0, 5, 0) --Move the camera up 5 studs angle = angle + norm end |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2013 02:03 AM |
if game.Players.LocalPlayer.Character:findFirstChild("Shirt") then game.Players.LocalPlayer.Character.Shirt:Destroy() end
Same for pants..
-Knowledge is power- |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2013 02:04 AM |
The shirt isn't loaded. Ever noticed when you forst join a game you're not wearing anything right away.
Change..
if game.Players.LocalPlayer.Character.Shirt ~= nil then
too
if game.Players.LocalPlayer.Character:FindFirstChild ("Shirt") ~= nil then |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2013 02:07 AM |
~= nil part isn't even needed. And if statement combined with a findFirstChild will do nothing when it can't find the child :)
-Knowledge is power- |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2013 04:07 AM |
| I know. But it's how I learned it a while back. So I just stick with it. |
|
|
| Report Abuse |
|
|
Voxility
|
  |
| Joined: 15 Apr 2013 |
| Total Posts: 584 |
|
|
| 24 Apr 2013 06:34 AM |
Do
pcall(function() game:GetService("Players").LocalPlayer.Character:findFirstChild("Shirt"):Destroy() end) |
|
|
| Report Abuse |
|
|
iStone4S
|
  |
| Joined: 07 May 2012 |
| Total Posts: 416 |
|
|
| 24 Apr 2013 07:07 AM |
| Voxility's way is my preferred way. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 24 Apr 2013 01:55 PM |
*facepalm*
Well I figured it was a simple error. Also, would :WaitForChild("Shirt") be more ideal, since if the shirt hasn't been created yet the script will just proceed on...
~ The ATR Fishie ~ |
|
|
| Report Abuse |
|
|