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
 

Why this wont work?

Previous Thread :: Next Thread 
Ace23333 is not online. Ace23333
Joined: 20 Nov 2011
Total Posts: 1341
17 May 2014 09:11 AM
It does tween, but not to the position it should, why?

mouse.Button2Down:connect(function()
if mouse.Target.Name == "Grass" and
(mouse.Hit.p - game.Players.LocalPlayer.Character.Torso.Position).magnitude<10
and debounce3 == false then

if Inv:findFirstChild("Grass") == nil then
newgrass = Inv:findFirstChild("None")
newgrass.Name = "Grass"
newgrass.Num.Value = newgrass.Num.Value + 1
script.Picked:play()
gui2 = newgrass:clone()
gui2.Parent = Player.PlayerGui.Inventory.Frame
gui2.Position = UDim2.new(0, mouse.X, 0, mouse.Y)
wait(0.05)
gui2:TweenPosition(UDim2.new(0, newgrass.Position.X, 1, -48), "Out", "Quad", 0.5)

-- Line above breaks, It tweens but not to the newgrass.Position.X, it goes randomly to end of screen

wait(0.5)
gui2:remove()
Report Abuse
Verthandi is not online. Verthandi
Joined: 21 Apr 2014
Total Posts: 65
17 May 2014 09:16 AM
"newgrass.Position.X"

Remember that there is Offset and Scale.

You probably want newgrass.Position.X.Offset
Report Abuse
Verthandi is not online. Verthandi
Joined: 21 Apr 2014
Total Posts: 65
17 May 2014 09:18 AM
Wait, is newGrass a part?

If so, ignore what I just said.
Report Abuse
Ace23333 is not online. Ace23333
Joined: 20 Nov 2011
Total Posts: 1341
17 May 2014 09:22 AM
No, newgrass is a TextButton, its one of 12 "Inventory Slots"
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
17 May 2014 09:24 AM
xD
Report Abuse
Ace23333 is not online. Ace23333
Joined: 20 Nov 2011
Total Posts: 1341
17 May 2014 09:25 AM
Ohh! Offset worked! Thank you
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
17 May 2014 09:27 AM
Funny how I posted the same solution in your other thread and you didn't use it.
Report Abuse
Ace23333 is not online. Ace23333
Joined: 20 Nov 2011
Total Posts: 1341
17 May 2014 09:27 AM
I was playing minecraft, I think I forgot about it... Sorry
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