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