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: How would I run a local function inside another function?

Previous Thread :: Next Thread 
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
12 Sep 2015 04:21 PM
I have this, but it doesn't seem to work.
Note, there's more above.

function AssignSettings()
local AssignedSetting = false
local function ApplyRanks()
for Players in string.gmatch(AdminSettings["Ranks"]["Owner"].Value, "%w+") do table.insert(Settings.Ranks["Owner"], Players) AssignedSetting = true end
for Players in string.gmatch(AdminSettings["Ranks"]["CoOwner"].Value, "%w+") do table.insert(Settings.Ranks["CoOwner"], Players) AssignedSetting = true end
for Players in string.gmatch(AdminSettings["Ranks"]["Moderator"].Value, "%w+") do table.insert(Settings.Ranks["Moderator"], Players) AssignedSetting = true end
for Players in string.gmatch(AdminSettings["Ranks"]["VIP"].Value, "%w+") do table.insert(Settings.Ranks["VIP"], Players) AssignedSetting = true end
for Players in string.gmatch(AdminSettings["Ranks"]["Member"].Value, "%w+") do table.insert(Settings.Ranks["Member"], Players) AssignedSetting = true end
for Players in string.gmatch(AdminSettings["Ranks"]["Admin"].Value, "%w+") do table.insert(Settings.Ranks["Admin"], Players) AssignedSetting = true end
for Players in string.gmatch(AdminSettings["Ranks"]["Banned"].Value, "%w+") do table.insert(Settings.Ranks["Banned"], Players) AssignedSetting = true end
for Players in string.gmatch(AdminSettings["Ranks"]["Crashed"].Value, "%w+") do table.insert(Settings.Ranks["Crashed"], Players) AssignedSetting = true end
for Players in string.gmatch(AdminSettings["Ranks"]["Muted"].Value, "%w+") do table.insert(Settings.Ranks["Muted"], Players) AssignedSetting = true end
return AssignedSetting
end
local function Apply_()
if Settings.Prefix then Settings.Prefix = AdminSettings.Prefix.Value AssignedSetting = true end
if Settings.Bet then Settings.Bet = AdminSettings.Bet.Value AssignedSetting = true end
return AssignedSetting
end
ApplyRanks() Apply_()
end
function onPlayerAdded(Player)
return Player
end
Server.Players.PlayerAdded:connect(onPlayerAdded, AssignSettings)
for _,c in pairs(Settings.Ranks["Owner"]) do print(c) end


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
12 Sep 2015 04:23 PM
I have no idea what you're trying to do, so I'll respond to the title.

function MyFunction()
local newFunction = function(x,y)
print(x,y)
end
end
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
12 Sep 2015 04:26 PM
Oh, this is a small fragment of an admin script I am currently scripting.


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
12 Sep 2015 04:29 PM
So, anyone know?


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
12 Sep 2015 04:38 PM
Anyone?
Little help would be nice.


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
davisky2 is not online. davisky2
Joined: 04 Mar 2012
Total Posts: 4710
12 Sep 2015 04:42 PM
didnt the previous one work?


~davisky~
Report Abuse
robomax11 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
12 Sep 2015 04:53 PM
function Swag(arg)
local function nope(not)
print(not)
end;
nope(arg);
end

Swag("hi") >hi
nope('hi') >nil becus function is local


| 432,147 | R$42,344 | swag
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Sep 2015 04:56 PM
hehehe

function a(c)
function b()
c = c + 1
print(c)
end
end

a(0) b()b()b()
a(0) b()b()b()
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
12 Sep 2015 05:01 PM
@David
What previous one?


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
12 Sep 2015 05:02 PM
"@David"
I mean @Davis


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
12 Sep 2015 05:22 PM
Still a little confused.


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
12 Sep 2015 05:39 PM
Hmm, anyone?


“Insane isn't always black or white. We're all pathological, in our own ways.”
Report Abuse
notfruit is not online. notfruit
Joined: 21 Sep 2012
Total Posts: 1386
12 Sep 2015 05:44 PM
If you need to run a local function inside another function then you're probably doing something wrong.

Think about what ur code has to do and split up tasks into groups. Put those groups into modules and those modules into functions and hook them up. Rewrite your code and don't do it again, young man. >:(
Report Abuse
Luxurize is not online. Luxurize
Joined: 31 Mar 2015
Total Posts: 1289
12 Sep 2015 06:30 PM
Aaaand once again, stupid me didn't realise the main function wasn't even being called.
Welp, derp.


“Insane isn't always black or white. We're all pathological, in our own ways.”
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