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: Please help me fix this script:

Previous Thread :: Next Thread 
redblock88 is not online. redblock88
Joined: 24 Mar 2010
Total Posts: 1641
06 Sep 2014 09:31 AM

The script i have here is inside a LocalScript inside of StarterGui. It makes a button that says 'Jump' on it, which should make another Gui, called 'Character'
increase Y by 100 for 0.2 of a second then return to it's original value of Y, but for some reason, it doesent work. If you could help, me that'd be great!



local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent


local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 50)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "Jump"

textButton.MouseButton1Down:connect(function()
game.StarterGui.Character.TextButton.UDim2.Y(0,400)
wait(0.2)
game.StarterGui.Character.TextButton.Udim2.Y(0,300)
end)



Thanks for reading.

BTW, I am not very good with 'UDim', that may be the problem.
Report Abuse
14095653 is not online. 14095653
Joined: 01 Aug 2014
Total Posts: 179
06 Sep 2014 11:56 AM
I don't know if this helps, but skip a line between 11 and 12 so the blank line becomes line 12. Then add textButton.MouseButton1Down:connect(Function). The function is capped because it checks for a click. Idk, the wiki might be outdated, but just try it.
Report Abuse
14095653 is not online. 14095653
Joined: 01 Aug 2014
Total Posts: 179
06 Sep 2014 12:00 PM
Wait, no, scratch that last post. For game.StarterGui.Character.TextButton.UDim2.Y(0,400)
and
game.StarterGui.Character.TextButton.UDim2.Y(0,300)

you forgot .new()after UDim2. You only had UDim2.Y. It should go:

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent


local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 50)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "Jump"

textButton.MouseButton1Down:connect(function()
game.StarterGui.Character.TextButton.UDim2.new(0,400,0)
wait(0.2)
game.StarterGui.Character.TextButton.Udim2.new(0,300,0)
end)

<(o.o)>
Report Abuse
redblock88 is not online. redblock88
Joined: 24 Mar 2010
Total Posts: 1641
06 Sep 2014 12:07 PM
Hmm, still isnt working..

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent


local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 50)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "Jump"

textButton.MouseButton1Down:connect(function()
game.StarterGui.Character.TextButton.UDim2.new(0,400,0)
wait(0.2)
game.StarterGui.Character.TextButton.Udim2.new(0,300,0)
end)



DO i need to put the LocalScript inside of Character? Or just in StarterGui?
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