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 » Scripters
Home Search
 

Re: Script crashes my game, please help!

Previous Thread :: Next Thread 
JoeRaptor is not online. 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 is not online. JoeRaptor
Joined: 08 Sep 2012
Total Posts: 282
23 Jan 2017 12:03 AM
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Report Abuse
JoeRaptor is not online. JoeRaptor
Joined: 08 Sep 2012
Total Posts: 282
23 Jan 2017 12:05 AM
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
Report Abuse
JoeRaptor is not online. JoeRaptor
Joined: 08 Sep 2012
Total Posts: 282
23 Jan 2017 12:06 AM
paste
bin.
com/
eBWKNXv9
Report Abuse
JoeRaptor is not online. 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 is online. 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 is online. 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 is not online. 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 is not online. JoeRaptor
Joined: 08 Sep 2012
Total Posts: 282
23 Jan 2017 12:26 AM
* an award, thank you
Report Abuse
qqtt991 is online. 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 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
23 Jan 2017 12:29 AM
No problem.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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