A Roblox Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

A Roblox Community

A community of Robloxians who want to learn to script and build on Roblox Studio.
 
HomeLatest imagesRegisterLog in
If you're a experienced coder make some tutorials! It would really help the site grow.
Make sure you read the rules(Which can be found by clicking here)
If you're a beginner at coding, try some tutorials.
We have many Moderators/Admins watching this site. Contact them with Questions.
Let us know what your favorite sport is. By clicking here to vote (Click here)
This site is becoming inactive. Lets make it active.
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Top posters
blueymaddog
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
naknak
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
Supernapalm
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
m27frogy
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
slayer9365
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
myrco919
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
branefreez
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
ninga95
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
CloneTrooper787
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
raboy117
Refering to functions as objects? Vote_lcapRefering to functions as objects? Voting_barRefering to functions as objects? Vote_rcap 
Top posting users this month
No user
Latest topics
» Where to go from here.
Refering to functions as objects? EmptySeptember 14th 2020, 1:20 pm by MrNicNac

» Send me an Email
Refering to functions as objects? EmptySeptember 14th 2020, 1:16 pm by MrNicNac

» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]
Refering to functions as objects? EmptyJuly 6th 2015, 7:38 pm by m27frogy

» New Site Possibly
Refering to functions as objects? EmptyJuly 6th 2015, 4:16 pm by m27frogy

» Ambassador!
Refering to functions as objects? EmptyApril 15th 2015, 11:40 pm by naknak

» Boop - Tag
Refering to functions as objects? EmptyApril 13th 2015, 9:46 pm by naknak

» Vip Class Script
Refering to functions as objects? EmptyApril 13th 2015, 4:54 pm by naknak

» Who's active?!
Refering to functions as objects? EmptyApril 13th 2015, 4:52 pm by naknak

» Genesis Point
Refering to functions as objects? EmptyJuly 17th 2014, 7:04 pm by branefreez

» Reward System
Refering to functions as objects? EmptyJuly 17th 2014, 5:41 am by m27frogy

» Script Request
Refering to functions as objects? EmptyJuly 10th 2014, 11:43 am by naknak

» local scripts?
Refering to functions as objects? EmptyJuly 10th 2014, 11:39 am by naknak

» Project: Reconstruction [Died]
Refering to functions as objects? EmptyJuly 10th 2014, 11:36 am by naknak

» Hi. I am new here
Refering to functions as objects? EmptyApril 26th 2014, 4:01 pm by altshiftkey

» What's your favorite sport?
Refering to functions as objects? EmptyJanuary 1st 2014, 2:13 pm by m27frogy

» FlashLight Script
Refering to functions as objects? EmptyJanuary 1st 2014, 2:11 pm by m27frogy

» Gun Making! [READ DESC]
Refering to functions as objects? EmptyJanuary 1st 2014, 2:10 pm by m27frogy

» Hi, I am new here!
Refering to functions as objects? EmptyNovember 26th 2013, 3:33 pm by Keanu73

» Improve Coding
Refering to functions as objects? EmptyOctober 26th 2013, 1:12 pm by pook03

» Simple Button
Refering to functions as objects? EmptySeptember 1st 2013, 6:19 pm by branefreez


 

 Refering to functions as objects?

Go down 
3 posters
AuthorMessage
Sethalonian
Intermediate Scripter
Intermediate Scripter
Sethalonian


Posts : 63
Join date : 2011-06-10
Age : 26

Refering to functions as objects? Empty
PostSubject: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 18th 2012, 7:36 pm

I've noticed in Telamon's leaderstats script, that he refers to "killer" as an object, but its value is a function? How is that possible? How can I use this to create and insert a table of guis?
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 18th 2012, 9:47 pm

How is it referenced?
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 19th 2012, 4:43 am

i thought 'killer' was an object value...
Back to top Go down
Sethalonian
Intermediate Scripter
Intermediate Scripter
Sethalonian


Posts : 63
Join date : 2011-06-10
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 19th 2012, 8:44 am

local killer = getKillerOfHumanoidIfStillInGame(humanoid)

if killer ~= nil then
...
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 20th 2012, 3:32 am

that means it it was referring the the values returned from that function not the function itself:

function aFunction()
return 10
end

aCall = aFunction()
aFunctionReference = aFunction
print(aCall)
print(aFunctionRefence)

>10
>function: [hexadecimalcodehere]
Back to top Go down
Sethalonian
Intermediate Scripter
Intermediate Scripter
Sethalonian


Posts : 63
Join date : 2011-06-10
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 20th 2012, 8:38 am

Cool, but can you refer to more than one object, or maybe a table?
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 21st 2012, 3:30 am

function ReturnTable()
return {1,4,3,5}
end

function Return3Values()
return 1,3,5
end

tab = ReturnTable()
x,y,z = Return3Values()

print(x,z)
>1 5
print(tab[2],tab[4])
>4 5
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 21st 2012, 3:35 am

you can even reference objects like in the leaderboard script:

function ReturnWorkspace()
return worksapce
end

work = ReturnWorkspace()

print(work.Name)
Back to top Go down
Sethalonian
Intermediate Scripter
Intermediate Scripter
Sethalonian


Posts : 63
Join date : 2011-06-10
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 21st 2012, 9:20 am

worksapc? Anyway, thats cool. I didn't really know what the whole point of return even was... I thought it would just like... reset the function of something...
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 23rd 2012, 2:42 am

whoops, typo i mean to say Workspace

return has many uses... i was just showing how it returns values from functions because you were wondering. i could explainmore if u wanted.
Back to top Go down
Sethalonian
Intermediate Scripter
Intermediate Scripter
Sethalonian


Posts : 63
Join date : 2011-06-10
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 23rd 2012, 12:58 pm

Ok. What else can it do? I think I heard it can like return to the beginning of a function if the requirements can't be met.... btw Have you ever used tweening?
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 28th 2012, 5:03 am

nope, :P first time i tried it it didn't work so I used my own method that was slower :P
Back to top Go down
Sethalonian
Intermediate Scripter
Intermediate Scripter
Sethalonian


Posts : 63
Join date : 2011-06-10
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 28th 2012, 11:28 am

XD
Back to top Go down
Sethalonian
Intermediate Scripter
Intermediate Scripter
Sethalonian


Posts : 63
Join date : 2011-06-10
Age : 26

Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? EmptyMarch 28th 2012, 11:29 am

Ok, Answer me this, How do you get text to slide out of a gui without moving outside of it, and not showing text or anything? I don't understand it...
Back to top Go down
Sponsored content





Refering to functions as objects? Empty
PostSubject: Re: Refering to functions as objects?   Refering to functions as objects? Empty

Back to top Go down
 
Refering to functions as objects?
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
A Roblox Community :: Questions and Help :: Scripting-
Jump to: