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 » Scripters
Home Search
 

Functions D:

Previous Thread :: Next Thread 
Francisl4d45 is not online. Francisl4d45
Joined: 14 Aug 2010
Total Posts: 347
11 Aug 2016 04:14 PM
I get an error "attempt to index local 'land'(a function value)"

object.Parent = workspace
local land = findPos-- this is a value function
if land ~= nil then
object.PrimaryPart.CFrame = land.CFrame --HERE I get an error
else
print("Error")
end
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
11 Aug 2016 04:18 PM
If land is a function, then functions don't have CFrames and you can't do that. Did you mean to call it first?

land().CFrame


Report Abuse
fixylol is not online. fixylol
Joined: 14 Dec 2012
Total Posts: 7412
11 Aug 2016 04:18 PM
that's because you're setting the value of "land" to findPos, which is a function. if you want to set the value of land to the value that findPos returns, you need to call it like a function.

Number of times my opinion changed: Alot.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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