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: wanna know what pisses me off

Previous Thread :: Next Thread 
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 04:54 PM
when people use == and ~= for stuff that isn't math

like

instead of

if humanoid ~= nil then

just use

if humanoid then

like srsly
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
06 Apr 2015 04:56 PM
You mad bro?

I use that all the time because I use 2008 style scripting.
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 04:56 PM
well you need to start using modern stuff

people like me won't wanna help you w/ your code
Report Abuse
wonuf is not online. wonuf
Joined: 28 May 2013
Total Posts: 133
06 Apr 2015 04:57 PM
I do that too

local AbstractMadnessIsMad = true

if AbstractMadnessIsMad then
print('Mad bro?')
end
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 04:58 PM
@wonuf

you are a good human being
Report Abuse
vividtrip is not online. vividtrip
Joined: 14 Oct 2008
Total Posts: 2890
06 Apr 2015 04:58 PM
I'd assume that the concept is quite difficult to understand at first. Trying to understand things as either 'True' or 'False' is sort-of similar to trying to learn a totally new language.


[very moisty]
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 04:59 PM
it's not hard at all

if you put nothing, it assumes you but == true... or to check if its there, if you put "if not humanoid" then it's just like if humanoid ~= nil, but better.
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
06 Apr 2015 04:59 PM
OMG Y THIS NO WORK IM RAGING !!!!!111



while false do
if workspace ~= nil then
script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent = true
end
end
end
Report Abuse
wonuf is not online. wonuf
Joined: 28 May 2013
Total Posts: 133
06 Apr 2015 04:59 PM
Ahah, but to be fair if you do use the old styles, it is easier to point out and go back to when editing scripts.
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 05:03 PM
@025

best scripter award goes to.... `YOUU
Report Abuse
vividtrip is not online. vividtrip
Joined: 14 Oct 2008
Total Posts: 2890
06 Apr 2015 05:03 PM
@AbstractMadness
Although you're correct, I'd assume that you're an experienced Lua scripter. When I was slightly more of a newbie than I am now, I struggled to grasp the concept of a Boolean, event or parameter.

[very moisty]
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 05:04 PM
i wouldnt say i'm experienced... idk where i'd put myself on the thingy for scoring

i think i'm bad because i can't create an actual game, or have no ideas.. so i can't display my skills... so yeah. it sucks having no imagination.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
06 Apr 2015 05:07 PM
local thing = ''
local othing = false
if thing then print ('Not falsey') end;
if thing ~= nil then print ('Exist') end;
if othing then print('Oh noes') end;
if othing ~= nil then print ('Exist') end;
if thing == true then print('Nononono') end


That's why.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
06 Apr 2015 05:07 PM
function onTouch(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil then
local p = game.Players:FindFirstChild(hit.Parent.Name)
if p ~= nil then
p.PlayerGui.ScreenGui.Frame.Visible = true
elseif p == nil then
print("No layer")
end
elseif humanoid == nil then
print("No Humanoid")
end
end

script.Parent.Touched:connect(onTouch)
Report Abuse
wonuf is not online. wonuf
Joined: 28 May 2013
Total Posts: 133
06 Apr 2015 05:08 PM
That script makes me die inside..
Report Abuse
vividtrip is not online. vividtrip
Joined: 14 Oct 2008
Total Posts: 2890
06 Apr 2015 05:08 PM
@AbstractMadness
Scripting is a very small part of the gamedev process. There's all that other stuff, like the building, design and the such. I suck at anything other than making useless scripts, so I'd rather stick to helping people on the forum.


[very moisty]
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 05:09 PM
@eLunate

what
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
06 Apr 2015 05:09 PM
That's because Lua works differently than a lot of other languages. The condition will pass in Lua if it is not nil and not false. In many languages (such as Java, where a lot of programmers are coming from) the condition has to evaluate to true to pass. Putting a non boolean (an object in most cases) in the condition is pretty unusual for someone who doesn't program in Lua or C++ all the time, and even for someone coming from C++ it's still pretty unusual.
Report Abuse
wonuf is not online. wonuf
Joined: 28 May 2013
Total Posts: 133
06 Apr 2015 05:09 PM
---2008

function onTouch(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil then
local p = game.Players:FindFirstChild(hit.Parent.Name)
if p ~= nil then
p.PlayerGui.ScreenGui.Frame.Visible = true
elseif p == nil then
print("No layer")
end
elseif humanoid == nil then
print("No Humanoid")
end
end

script.Parent.Touched:connect(onTouch)

---2015

script.Parent.Touched:connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
local p = game.Players:FindFirstChild(hit.Parent.Name)
if p then
p.PlayerGui.ScreenGui.Frame.Visible = true
elseif not pthen
print("No layer")
end
elseif not humanoid then
print("No Humanoid")
end
end
end
.
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 05:10 PM
@vivid

me

in

words
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
06 Apr 2015 05:11 PM
Also, just a tip,

if p ~= nil then
p.PlayerGui.ScreenGui.Frame.Visible = true
else then --if the first condition is false, since it is the same boolean being evaluated (p to nil) then you automatically know p is nil, so you don't have to check what it is.
print("No layer")
end
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
06 Apr 2015 05:12 PM
Those do the exact same thing. So why do people get mad over "omg ThAs NUt 3Fficeeeent"

Lua code fires in milliseconds so the time for an "efficient" code and "unefficient" code to do the EXACT same thing is useless to measure and is a waste of time.
Report Abuse
vividtrip is not online. vividtrip
Joined: 14 Oct 2008
Total Posts: 2890
06 Apr 2015 05:14 PM
@TimeTicks
Not only does it look nicer (In my opinion), but it's good practice, I'd assume.

[very moisty]
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
06 Apr 2015 05:14 PM
And FYI, for code that is considered "Deprecated" who gives a rats ass? Until roblox convinces me that they will get rid of :Remove() and replace it with :Destroy() I'm still going to use :Remove(). They do the exact same thing.
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
06 Apr 2015 05:14 PM
Because.. It's not the updated stuff. They wouldn't have updated for better things if they wanted you to still use the old things.
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