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: Cframe Loops Problem

Previous Thread :: Next Thread 
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
11 Feb 2014 08:28 AM
function BuyDebre()
for _, v in pairs(Game.Workspace:GetChildren()) do
if (v.Name == script.interact.Value.Name) then
model = v:GetChildren()
for x=1,20 do
model[x].CFrame = model[x].CFrame * CFrame.new(0,-0.07,0)---ERROR LINE
wait(0.025)
end
end
end
end


Players.Player1.PlayerGui.GunBuy:2718: attempt to index field '?' (a nil value)
Report Abuse
Mikesly is not online. Mikesly
Joined: 07 Sep 2007
Total Posts: 4593
11 Feb 2014 08:44 AM
Try using Workspace or game.Workspace instead of Game.Workspace.
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
11 Feb 2014 09:06 AM
@Mikesly shut up

There are probably objects in the model which aren't parts. So add a check:

function BuyDebre()
for _, v in pairs(Game.Workspace:GetChildren()) do
if (v.Name == script.interact.Value.Name) then
model = v:GetChildren()
for x=1,20 do
if model[x]:IsA('BasePart') then --THE CHECK
model[x].CFrame = model[x].CFrame * CFrame.new(0,-0.07,0)---ERROR LINE
wait(0.025)
end
end
end
end
end
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
11 Feb 2014 02:16 PM
Nope still shows the same error.
Report Abuse
solvar is not online. solvar
Joined: 22 May 2011
Total Posts: 149
11 Feb 2014 03:01 PM
Try

IsA:("Part")

Instead
Warning this worked for me but don't get mad if it doesn't work
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
18 Feb 2014 05:33 PM
...
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
20 Feb 2014 02:33 PM
?
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