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
 

Re: Can someone help me with this error??

Previous Thread :: Next Thread 
0071ronman is not online. 0071ronman
Joined: 09 Jan 2016
Total Posts: 99
17 Jan 2017 11:22 AM
So, there's this script that I've spent quite a bit of time making and i was testing it to see if it would work. I fixed some errors but then I came accross one that doesn't make any sense to me. The Error says Value is not a valid member of UDim2, I know what that means but looking in the script, I can't find where I went wrong. If someone could help then that would be great.

Here's the WHOLE script:

local val = 0
local previous = 0

function Run2()
script.Parent.Parent.Amount.Value = script.Parent.Parent.Amount.Value + 1
script.Parent.place.Value = script.Parent.place.Value + 1
end

function Run1(New)
print("1")
if previous > New then
script.Parent.place.Value = script.Parent.place.Value + 1
elseif previous < New then
script.Parent.place.Value = script.Parent.Position.Value - 1 ^^This is where the error occurs^^
end
if script.Parent.place.Value == 1 then
val = 0
elseif script.Parent.place.Value == 2 then
val = 0.2
elseif script.Parent.place.Value == 3 then
val = 0.4
elseif script.Parent.place.Value == 4 then
val = 0.6
elseif script.Parent.place.Value == 5 then
val = 0.8
elseif script.Parent.place.Value >= 6 then
val = 1
script.Parent.Visible = false
end
script.Parent.Position = UDim2.new(0,0,val,0)
end

script.Parent.Activation.Changed:connect(Run2)
script.Parent.Parent.Amount.Changed:connect(Run1)

while true do
previous = script.Parent.Parent.Amount.Value
wait(1)
end

Thnx,0071ronman
Report Abuse
BIueNarwhaI is not online. BIueNarwhaI
Joined: 10 Apr 2012
Total Posts: 866
17 Jan 2017 11:25 AM
Is it definitely an integer/float value? I can't see anything else wrong with it.

And can Position recieve a UDim2? Thought it was only Vector3
Seeing as there aren't four planes in 3D space


Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
17 Jan 2017 11:26 AM
script.Parent.Position is an UDim2 (the position of a 2D GUI element)

You're trying to .Value that, but it doesn't have that property.

You also can't + 1 on a UDim2 since it's 2 tables within a table.

http://wiki.roblox.com/index.php?title=UDim2
Report Abuse
BIueNarwhaI is not online. BIueNarwhaI
Joined: 10 Apr 2012
Total Posts: 866
17 Jan 2017 11:27 AM
Oh ye lol. My apologies.

And isn't he just adding to a single value, it doesn't include UDim2 until the end of the function.


Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
17 Jan 2017 11:30 AM
You probably mean to do this:

script.Parent.place.Value = script.Parent.place.Value - 1

On that line, just the autocorrect kicking in
Report Abuse
0071ronman is not online. 0071ronman
Joined: 09 Jan 2016
Total Posts: 99
17 Jan 2017 11:39 AM
OMGGGGGGGGG SO ANNOYING I can't belive i missed that!!!!
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