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: "Define stupidity."

Previous Thread :: Next Thread 
gryphunk2 is online. gryphunk2
Joined: 04 Mar 2013
Total Posts: 10872
20 Nov 2017 07:30 PM
plr = Game.Players.LocalPlayer
m = plr:GetMouse()

m.KeyDown:connect(function(key)
if key == ('f') then
Game.Workspace.Part:remove()
end
end)


heccled by the master heccler again
Report Abuse
Pastures is not online. Pastures
Joined: 15 Aug 2015
Total Posts: 943
20 Nov 2017 07:32 PM
- using mouse for keyboard input
- using :connect instead of :Connect
- using :remove instead of destroy
- no indentations = ugly code
Report Abuse
yin_yang is not online. yin_yang
Joined: 24 Feb 2016
Total Posts: 537
20 Nov 2017 07:33 PM
more like using a deprecated form of input registration
Report Abuse
gryphunk2 is online. gryphunk2
Joined: 04 Mar 2013
Total Posts: 10872
20 Nov 2017 07:34 PM
DAMNIT I FORGOT ABOUT INDENTATIONS


heccled by the master heccler again
Report Abuse
Pastures is not online. Pastures
Joined: 15 Aug 2015
Total Posts: 943
20 Nov 2017 07:36 PM
oh ignore the indentations parts

i was looking at your post through the reply window
reply window removes whitespace for some reason

you can see for yourself and click "reply" to your original post and you will see it removed indentations. its roblex again
Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
20 Nov 2017 07:37 PM
@pastures

I was confused and I thought I was scripting wrong all this time or something lol


Report Abuse
gryphunk2 is online. gryphunk2
Joined: 04 Mar 2013
Total Posts: 10872
20 Nov 2017 07:39 PM
also
- not making variables local
- Game
- Game.ServiceName instead of game:GetService("ServiceName")
- ('') instead of ""
- Game.Workspace instead of workspace
- remove()
- connect()

i really wish that there was an old "player:mouse()" method so i could make this more deprecated (like there is with :children() and :players()"


heccled by the master heccler again
Report Abuse
TaaRt is online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
20 Nov 2017 07:43 PM
I'm willing to argue the actual increase in performance from 'not making variables local' is negligable unless it's code that runs more than once (where locals often ARE used)
Report Abuse
gryphunk2 is online. gryphunk2
Joined: 04 Mar 2013
Total Posts: 10872
20 Nov 2017 07:45 PM
🅱OI making every variable local would make your fps 59.999999


heccled by the master heccler again
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