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: How do I make this shorter?

Previous Thread :: Next Thread 
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
19 Jun 2014 05:31 PM
Seams kinda long for what it's suppose to do...

What I want it to do is when I click the button, ask to but something from the player, that works.
What else is when I hover over the GUI I want it to move to the right a bit, than when It leaves I want it to move back, but it's really glitchy and doesn't work all the time, and also I want to shorten up the code.




local MarketplaceService=Game:GetService("MarketplaceService")
local buy1=script.Parent.Buy1

script.Parent.Buy1.MouseButton1Click:connect(function()
MarketplaceService:PromptProductPurchase(player,20190046)
end)
buy1.MouseEnter:connect(function()
if not moving then
moveing=true
buy1:TweenPosition(UDim2.new(0,20,0,250),"Out","Quad",.2)
wait(.2)
moveing=false
end
end)
buy1.MouseLeave:connect(function()
if not moving then
moveing=true
buy1:TweenPosition(UDim2.new(0,0,0,250),"Out","Quad",.2)
wait(.2)
moveing=false
e
Report Abuse
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
19 Jun 2014 05:32 PM
the "e" at the end should be
end
end)
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
19 Jun 2014 05:32 PM
You keep spelling moving differently.

Get rid of that random e.
Report Abuse
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
19 Jun 2014 05:34 PM
Thanks, but can you make it shorter please?
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
19 Jun 2014 05:34 PM
Do you need the "if moving then moving = whatever" bit?

Cant you just do

MouseEnter event
Tween

MouseLeave event
Tween

(Too lazy, and you should get the point)
Report Abuse
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
19 Jun 2014 05:35 PM
It glitches the fk out and breaks when you try to tween the same thing at one time.
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
20 Jun 2014 01:42 AM
Them put bool override = false

So right before the final bracket of both Tweens put ,false.


Eg: ..."Quad",false)
Report Abuse
Oreoism is not online. Oreoism
Joined: 11 Apr 2014
Total Posts: 64
20 Jun 2014 03:03 AM
i'm on my ipod so this may or may not work

local MarketplaceService = Game:GetService("MarketplaceService")
local buy1 = script.Parent.Buy1

buy1.MouseButton1Click:connect(function()
MarketplaceService:PromptProductPurchase(player, 20190046)
end)
buy1.MouseEnter:connect(function()
buy1:TweenPosition(UDim2.new(0, 20, 0, 250), "Out", "Quad", 0.2, true)
end)
buy1.MouseLeave:connect(function()
buy1:TweenPosition(UDim2.new(0, 0, 0, 250), "Out", "Quad", 0.2, true)
end)
Report Abuse
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
20 Jun 2014 03:34 AM
Why do you need it shorter if the script works who cares xD
Report Abuse
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
20 Jun 2014 03:36 AM
lmao I didn't read the entire thing -Which I never do- kinda makes me look stupid sorry I thought you wanted the script shorter.
Report Abuse
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
20 Jun 2014 11:12 AM
I decied to just remove the tweening all together, it makes it work perfectly, and as I said before you can't Tween the same GUI twice before it stops.
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