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: Useless Roblox Coding

Previous Thread :: Next Thread 
Kyrothehero is not online. Kyrothehero
Joined: 14 Aug 2012
Total Posts: 306
26 Mar 2014 08:32 PM
Copy and paste my list below and add on your own ideas (please note that I have done testing on each of these and proved that there is another way to perform the same action without using the function)

1. game.Players: Get Player From Character (character)
2. human: Take Damage (damage)
3. game.Players.Number Players (sorry that that's the wrong name but the filter won't let me use it correctly)
4. Instance: Is A (class)
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
26 Mar 2014 08:34 PM
1. I Use this all the time
2. This checks if there is a force feild so this is usful
3. game.Players.Number Players -- This is not useless?,
4. Instance: Is A (class) -- I use all the time, is there a better way?
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
26 Mar 2014 08:53 PM
Well, other than #3 is a shortcut for e.g. #game:service("Players"):GetPlayers(), it is in fact used by ROBLOX to decide whether a server should shutdown or not. Why not instead note features that would benefit ROBLOX in a certain way?

Examples:
- ImageLabel / Decal hue (like vertexcolor, but... with/without Vector3-system?)
- ImageLabel transparency
- Custom fonts
- Canvas object to "replace" GUIs
- As, *nway, me slepi*
Report Abuse
Kyrothehero is not online. Kyrothehero
Joined: 14 Aug 2012
Total Posts: 306
26 Mar 2014 08:55 PM
1. Yes, there is an alternate way. If you're too lazy to figure it out, I'll tell you.
2. You can just use an if statement to check to see if one exists
3. It is very useless. If you're too lazy to figure it out, I'll tell you.
4. Yes. If you're too lazy to figure it out, I'll tell you.
Report Abuse
Kyrothehero is not online. Kyrothehero
Joined: 14 Aug 2012
Total Posts: 306
26 Mar 2014 08:55 PM
ninja
Report Abuse
Kyrothehero is not online. Kyrothehero
Joined: 14 Aug 2012
Total Posts: 306
26 Mar 2014 08:58 PM
A & -
roblox could just add an indestructible script that checks using another function method such as for item, child in pears (blame the filter) to see if there are 0 players and if there are, destroy the Lighting.
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
26 Mar 2014 08:59 PM
^ I'd highly recommend you to read up on the methods you point out as "useless" - remember that they've been made for a purpose, and helps making flexible systems (as e.g. ForceFields can be named anything, and I told you about NumberPlayers before, and :IsA is VERY usable. Look up object hierarchy for that sake...)

Please, before looking at the surface of what these methods does, look at how they work in different situations, and how well they work for others in "more uncommon environments".

- As, mustgonowohnonoschulbaihellugaim.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
26 Mar 2014 09:03 PM
Why make your own if statement if roblox has already put one if for you?
And I see no simpler way to get the player form the character..

Please tell me if there is a alternative to the :IsA"Class"
Report Abuse
Kyrothehero is not online. Kyrothehero
Joined: 14 Aug 2012
Total Posts: 306
26 Mar 2014 09:05 PM
above -
force fields can be named anything, however their class name never changes - also, Is A hierarchy functions can be substituted with if variable.Parent = = parent then. As for Number Players, I already told YOU before as well.
Report Abuse
Kyrothehero is not online. Kyrothehero
Joined: 14 Aug 2012
Total Posts: 306
26 Mar 2014 09:05 PM
ninja again :/
Report Abuse
Kyrothehero is not online. Kyrothehero
Joined: 14 Aug 2012
Total Posts: 306
26 Mar 2014 09:08 PM
since you're lazy, I'll tell you. this script may seem sloppy but that is BECAUSE OF THE FILTER and nothing more.

get player from character:

for item, child in pears (game.Players: Get Children) do if child.Name = = Character.Name then stuff end end

Is A:
if variable. Class Name = = "class" then stuff end


Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
26 Mar 2014 09:19 PM
They are made to make this more efficient and shorter. Also I never said you can't do the If statement to find the Force field, but why put all of that code when you can use do TakeDamage.
Report Abuse
Kyrothehero is not online. Kyrothehero
Joined: 14 Aug 2012
Total Posts: 306
26 Mar 2014 09:24 PM
Because most people think that the Roblox administrators and developers are lazy (I'm not saying that they are) so they put in useless coding - the only thing the functions are is ###### improvement that reduces lag by a split-second.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
26 Mar 2014 09:26 PM
They increase load times, and the time you have to type.
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Mar 2014 09:32 PM
if object.ClassName == "BasePart" then
return
end

works a tad faster than

if object:IsA("BasePart") then
return
end

not noticeable though.
Report Abuse
BinaryC0DER is not online. BinaryC0DER
Joined: 03 Jan 2014
Total Posts: 83
26 Mar 2014 09:33 PM
IsA is much better than classname
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Mar 2014 09:33 PM
I also don't see the point of this thread
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Mar 2014 09:37 PM
t = tick()
if workspace.ClassName == "Workspace" then
print(tick() - t)
end
>1.8119812011719e-005

t = tick()
if workspace:IsA("Workspace") then
print(tick() - t)
end
>3.6478042602539e-005
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Mar 2014 09:42 PM
"above -
force fields can be named anything, however their class name never changes - also, Is A hierarchy functions can be substituted with if variable.Parent = = parent then. As for Number Players, I already told YOU before as well."

can you not
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
26 Mar 2014 09:42 PM
So its ~2.5 times faster to use ClassName =="" ?
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Mar 2014 09:48 PM
mhm
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
26 Mar 2014 10:33 PM
1. There is a reason why methods like these were added: simplicity.
2. Refer to #1
3. Players.NumPlayers would be good for optimizing code
4. IsA and ClassName are two different things. IsA checks for derived classes of the given class and ClassName is just for checking a single class or even just logging it (or something along the lines of that).
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
26 Mar 2014 10:50 PM
...
Why are you complaining about >EXTRA< stuff?
You don`t have to use them if you don`t want to.
:IsA checks for super classes.
game.Players.NumberPlayers makes it so you don`t have to generate a table
TakeDamage is a lot faster then if statements and looks neater.
Get player from character? Bleh. I don`t really use that one much.
Report Abuse
Kyrothehero is not online. Kyrothehero
Joined: 14 Aug 2012
Total Posts: 306
27 Mar 2014 10:34 AM
I'm not complaining...
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
27 Mar 2014 10:34 AM
Yes you are.
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