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: attempt to call field 'Position' (a user data value)

Previous Thread :: Next Thread 
MrGovernor is not online. MrGovernor
Joined: 27 Mar 2010
Total Posts: 522
13 Aug 2014 11:28 PM
So I'm making a Sliding Gate triggered by a Surface Gui and I get attempt to call field 'Position' (a user data value)

My Script(that I'm willing to share):

ComputerToDoors = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Doors
function onClicked()
if ComputerToDoors.CCdoor.Left.Position(-77, 28.9, 123.5) == true then -- The Error showed up when I added this!

script stuff(nothing wrong with this part)
script stuff(nothing wrong with this part)
script stuff(nothing wrong with this part)
script stuff(nothing wrong with this part)

script.Parent.MouseButton1Click:connect(onClicked)

I'd much appreciate it if you could tell me how to fix this error.
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
13 Aug 2014 11:31 PM
ComputerToDoors.CCdoor.Left.Position(-77, 28.9, 123.5) == true

...What is that line even supposed to do? If it's supposed to check whether the position is the value in parenthesis, that's not how to do it.

ComputerToDoors.CCdoor.Left.Position == Vector3.new(-77, 28.9, 123.5)

Is closer.
Report Abuse
MrGovernor is not online. MrGovernor
Joined: 27 Mar 2010
Total Posts: 522
13 Aug 2014 11:37 PM
I was making it so that the door doesn't reopen if you click the green button twice. I would press the green button and the door would just close instantly and reopen..
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
13 Aug 2014 11:39 PM
Why not just have an Open variable that stores whether the door is open or closed?

At the moment if you move the door at all the script will break.
Report Abuse
TheLoyalPawn is not online. TheLoyalPawn
Joined: 03 Sep 2012
Total Posts: 56
13 Aug 2014 11:48 PM
cuz i sed so

cuz i sed so

cuz i sed so

cuz i sed so..

..m8
Report Abuse
jonathany123 is not online. jonathany123
Joined: 22 Oct 2011
Total Posts: 41
14 Aug 2014 12:05 AM
it would only be one = sign, not two. two is for comparison.
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