|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|