JoeRaptor
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 282 |
|
|
| 22 Jan 2017 11:49 PM |
In studio put this inside of a frame in Starter GUI or Player GUI!!!
The literal second I press the left shift button, the server crashes!
The script is supposed to decrease the width of a frame for as long as hold down a button.
I'm making a custom Sonic Ring Energy GUI.
local uis = game:GetService("UserInputService") local shrinking = false local r = 1/1000 -- gui should shrink by 0.1% on wait() but doesn't 0.001 as a percentage is 0.1% local gui = script.Parent -- change this at your discretion
function Shrink() shrinking = true while shrinking do local s = gui.Size gui.Size = s - UD############################################################end end
uis.InputBegan:connect(function(input,gp) if input.UserInputType == Enum.UserInputType.Keyboard and (not gp) then if input.KeyCode == Enum.KeyCode.LeftShift then Shrink() end end end)
uis.InputEnded:connect(function(input,gp) if input.UserInputType == Enum.UserInputType.Keyboard and (not gp) then if input.KeyCode == Enum.KeyCode.LeftShift then shrinking = false end end end) |
|
|
| Report Abuse |
|
|
JoeRaptor
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 282 |
|
|
| 23 Jan 2017 12:03 AM |
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # |
|
|
| Report Abuse |
|
|
JoeRaptor
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 282 |
|
|
| 23 Jan 2017 12:05 AM |
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # |
|
|
| Report Abuse |
|
|
JoeRaptor
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 282 |
|
| |
|
JoeRaptor
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 282 |
|
|
| 23 Jan 2017 12:11 AM |
Help?
The script above (not the link) is an edited script in which is the one i need help with!!! |
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 23 Jan 2017 12:18 AM |
| :T Try putting a wait() at the bottom of the while loop in your shrink function. function Shrink(gui) shrinking = true while shrinking do local s = gui.Size gui.Size = s - ############################################################ wait() end end |
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 23 Jan 2017 12:19 AM |
:T Try putting a wait() at the bottom of the while loop in your shrink function.
function Shrink(gui) shrinking = true while shrinking do local s = gui.Size gui.Size = s - UDim2.new(s.X.Scale*r, ###.Offset*r, s.Y.Scale*r,s.Y.Offset*r) wait() end end
|
|
|
| Report Abuse |
|
|
JoeRaptor
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 282 |
|
|
| 23 Jan 2017 12:25 AM |
| You deserve and award, because I can't believe it was that simple. |
|
|
| Report Abuse |
|
|
JoeRaptor
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 282 |
|
| |
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 23 Jan 2017 12:29 AM |
If you want something to happen visibly over time instead of immediately, always put a wait() in your loop.
|
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
| |
|