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 » Scripting Helpers
Home Search
 

Re: Can you have a...

Previous Thread :: Next Thread 
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
20 Aug 2011 12:24 AM
function inside of a function, inside of a function?
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
20 Aug 2011 12:25 AM
Yes.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
20 Aug 2011 12:31 AM
Yes, use coroutines.

<'eof' expected near 'end' on line 9001>
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
20 Aug 2011 12:31 AM
Also, can you fix this? I'm trying to combine two scripts and yeah that is not working quite was well..... It stops working at my .Changed function. :(

OUTPUT: Workspace.Leaderboard:49: ')' expected (to close '(' at line 25) near 'end'


--RAGEQUIT!!!!!!

wait(5)

function onPlayerEntered(player)
local a = Instance.new("IntValue")
a.Name = "leaderstats"
a.Parent = player

local b = Instance.new("IntValue")
b.Name = "Lvl"
b.Value = 1
b.Parent = a

local c = Instance.new("IntValue")
c.Name = "Exp"
c.Value = 0
c.Parent = a

local e = Instance.new("IntValue")
e.Name = "Gold"
e.Value = 100
e.Parent = a

c.Changed:connect(function() -------------------- 25.
if c.Value >= b.Value * 150 then
c.Value = c.Value - b.Value * 150
b.Value = b.Value+1
if player.Character ~= nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = 0
fireworks.formFactor = "Symmetric"
fireworks.Size = Vector3.new(1,1,1)
fireworks.BrickColor = BrickColor.Random()
fireworks.CFrame = player.Character.Head.CFrame + Vector3.new(0,2,0)
fireworks.Parent = game.Workspace
game:GetService("Debris"):AddItem(fireworks, 2)
fireworks.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. " leveled up! :D"
wait(3)
m.Parent = nil
end
end
end
end) --------------------------------- 49!!!!!111!
game.Players.ChildAdded:connect(onPlayerEntered)
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
20 Aug 2011 12:33 AM
wait(5)

function onPlayerEntered(player)
local a = Instance.new("IntValue")
a.Name = "leaderstats"
a.Parent = player

local b = Instance.new("IntValue")
b.Name = "Lvl"
b.Value = 1
b.Parent = a

local c = Instance.new("IntValue")
c.Name = "Exp"
c.Value = 0
c.Parent = a

local e = Instance.new("IntValue")
e.Name = "Gold"
e.Value = 100
e.Parent = a

c.Changed:connect(function()
if c.Value >= b.Value * 150 then
c.Value = c.Value - b.Value * 150
b.Value = b.Value+1
if player.Character ~= nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = 0
fireworks.formFactor = "Symmetric"
fireworks.Size = Vector3.new(1,1,1)
fireworks.BrickColor = BrickColor.Random()
fireworks.CFrame = player.Character.Head.CFrame + Vector3.new(0,2,0)
fireworks.Parent = game.Workspace
game:GetService("Debris"):AddItem(fireworks, 2)
fireworks.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. " leveled up! :D"
wait(3)
m.Parent = nil
end
end
end
end)
end
game.Players.ChildAdded:connect(onPlayerEntered)



______________________________________
-ElectricBlaze,

roblox.com/my/groups.aspx?gid=372
Join today for a scripting teacher!
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
20 Aug 2011 12:33 AM
wait(5)

function onPlayerEntered(player)
local a = Instance.new("IntValue")
a.Name = "leaderstats"
a.Parent = player

local b = Instance.new("IntValue")
b.Name = "Lvl"
b.Value = 1
b.Parent = a

local c = Instance.new("IntValue")
c.Name = "Exp"
c.Value = 0
c.Parent = a

local e = Instance.new("IntValue")
e.Name = "Gold"
e.Value = 100
e.Parent = a

c.Changed:connect(function() -------------------- 25.
if c.Value >= b.Value * 150 then
c.Value = c.Value - b.Value * 150
b.Value = b.Value+1
if player.Character ~= nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = 0
fireworks.formFactor = "Symmetric"
fireworks.Size = Vector3.new(1,1,1)
fireworks.BrickColor = BrickColor.Random()
fireworks.CFrame = player.Character.Head.CFrame + Vector3.new(0,2,0)
fireworks.Parent = game.Workspace
game:GetService("Debris"):AddItem(fireworks, 2)
fireworks.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. " leveled up! :D"
wait(3)
m.Parent = nil
end
end
end)
end--------------------------------- 49!!!!!111!
game.Players.ChildAdded:connect(onPlayerEntered)
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
20 Aug 2011 12:34 AM
wait(5)

function onPlayerEntered(player)
local a = Instance.new("IntValue")
a.Name = "leaderstats"
a.Parent = player

local b = Instance.new("IntValue")
b.Name = "Lvl"
b.Value = 1
b.Parent = a

local c = Instance.new("IntValue")
c.Name = "Exp"
c.Value = 0
c.Parent = a

local e = Instance.new("IntValue")
e.Name = "Gold"
e.Value = 100
e.Parent = a

c.Changed:connect(function() -------------------- 25.
if c.Value >= b.Value * 150 then
c.Value = c.Value - b.Value * 150
b.Value = b.Value+1
if player.Character ~= nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = 0
fireworks.formFactor = "Symmetric"
fireworks.Size = Vector3.new(1,1,1)
fireworks.BrickColor = BrickColor.Random()
fireworks.CFrame = player.Character.Head.CFrame + Vector3.new(0,2,0)
fireworks.Parent = game.Workspace
game:GetService("Debris"):AddItem(fireworks, 2)
fireworks.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. " leveled up! :D"
wait(3)
m.Parent = nil
end
end
end)
end --------------------------------- 49!!!!!111!
game.Players.ChildAdded:connect(onPlayerEntered)

Try that.

<'eof' expected near 'end' on line 9001>
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
20 Aug 2011 12:34 AM
Dangit Nate >:(
Dangit Floodcheck.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
20 Aug 2011 12:34 AM
I posted before all of you. :D

______________________________________
-ElectricBlaze,

roblox.com/my/groups.aspx?gid=372
Join today for a scripting teacher!
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
20 Aug 2011 12:34 AM
Ugh, late post >.<

<'eof' expected near 'end' on line 9001>
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
20 Aug 2011 12:35 AM
Dangit Ele D:<
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
20 Aug 2011 12:35 AM
Still stops working at the .Changed function :((
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
20 Aug 2011 12:35 AM
Haha. xD

______________________________________
-ElectricBlaze,

roblox.com/my/groups.aspx?gid=372
Join today for a scripting teacher!
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
20 Aug 2011 12:36 AM
wait(5)

function onPlayerEntered(player)
local a = Instance.new("IntValue")
a.Name = "leaderstats"
a.Parent = player

local b = Instance.new("IntValue")
b.Name = "Lvl"
b.Value = 1
b.Parent = a

local c = Instance.new("IntValue")
c.Name = "Exp"
c.Value = 0
c.Parent = a

local e = Instance.new("IntValue")
e.Name = "Gold"
e.Value = 100
e.Parent = a

c.Changed:connect(function() -------------------- 25.
if c=="Value" then
if c.Value >= b.Value * 150 then
c.Value = c.Value - b.Value * 150
b.Value = b.Value+1
if player.Character ~= nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = 0
fireworks.formFactor = "Symmetric"
fireworks.Size = Vector3.new(1,1,1)
fireworks.BrickColor = BrickColor.Random()
fireworks.CFrame = player.Character.Head.CFrame + Vector3.new(0,2,0)
fireworks.Parent = game.Workspace
game:GetService("Debris"):AddItem(fireworks, 2)
fireworks.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. " leveled up! :D"
wait(3)
m.Parent = nil
end
end
end
end)
end --------------------------------- 49!!!!!111!
game.Players.ChildAdded:connect(onPlayerEntered)

<'eof' expected near 'end' on line 9001>
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
20 Aug 2011 12:36 AM
Use this:

wait(5)

function onPlayerEntered(player)
local a = Instance.new("IntValue")
a.Name = "leaderstats"
a.Parent = player

local b = Instance.new("IntValue")
b.Name = "Lvl"
b.Value = 1
b.Parent = a

local c = Instance.new("IntValue")
c.Name = "Exp"
c.Value = 0
c.Parent = a

local e = Instance.new("IntValue")
e.Name = "Gold"
e.Value = 100
e.Parent = a

c.Changed:connect(function()
if c.Value >= b.Value * 150 then
c.Value = c.Value - b.Value * 150
b.Value = b.Value+1
if player.Character ~= nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = 0
fireworks.formFactor = "Symmetric"
fireworks.Size = Vector3.new(1,1,1)
fireworks.BrickColor = BrickColor.Random()
fireworks.CFrame = player.Character.Head.CFrame + Vector3.new(0,2,0)
fireworks.Parent = game.Workspace
game:GetService("Debris"):AddItem(fireworks, 2)
fireworks.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. " leveled up! :D"
wait(3)
m.Parent = nil
end
end
end)
end
game.Players.ChildAdded:connect(onPlayerEntered)

______________________________________
-ElectricBlaze,

roblox.com/my/groups.aspx?gid=372
Join today for a scripting teacher!
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
20 Aug 2011 12:36 AM
Also, It starts me at level 0. :(
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
20 Aug 2011 12:37 AM
Oops, trying to post before them results in insufficiency

wait(5)

function onPlayerEntered(player)
local a = Instance.new("IntValue")
a.Name = "leaderstats"
a.Parent = player

local b = Instance.new("IntValue")
b.Name = "Lvl"
b.Value = 1
b.Parent = a

local c = Instance.new("IntValue")
c.Name = "Exp"
c.Value = 0
c.Parent = a

local e = Instance.new("IntValue")
e.Name = "Gold"
e.Value = 100
e.Parent = a

c.Changed:connect(function(change) -------------------- 25.
if change=="Value" then
if c.Value >= b.Value * 150 then
c.Value = c.Value - b.Value * 150
b.Value = b.Value+1
if player.Character ~= nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = 0
fireworks.formFactor = "Symmetric"
fireworks.Size = Vector3.new(1,1,1)
fireworks.BrickColor = BrickColor.Random()
fireworks.CFrame = player.Character.Head.CFrame + Vector3.new(0,2,0)
fireworks.Parent = game.Workspace
game:GetService("Debris"):AddItem(fireworks, 2)
fireworks.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. " leveled up! :D"
wait(3)
m.Parent = nil
end
end
end
end)
end --------------------------------- 49!!!!!111!
game.Players.ChildAdded:connect(onPlayerEntered)


<'eof' expected near 'end' on line 9001>
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
20 Aug 2011 12:38 AM
We are racing.

Electric, did I miss something?

<'eof' expected near 'end' on line 9001>
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
20 Aug 2011 12:38 AM
It works! Thanks electric!
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
20 Aug 2011 12:38 AM
Yes, you have an extra end.

______________________________________
-ElectricBlaze,

roblox.com/my/groups.aspx?gid=372
Join today for a scripting teacher!
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
20 Aug 2011 12:38 AM
Ill let nate or ele take this one im too lazy to script right now

~~Lazy scriptor on the lose~~
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
20 Aug 2011 12:39 AM
No problem! :D

OT: HAHA, NATE! xD

______________________________________
-ElectricBlaze,

roblox.com/my/groups.aspx?gid=372
Join today for a scripting teacher!
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
20 Aug 2011 12:40 AM
function test()
local function abc()
print("ABC")
end
abc()
end

test()
> ABC


Yes.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
20 Aug 2011 12:40 AM
Ugh, then why didn't the output print "eof expected.."? Next tiem post output!11!!!!!1

<'eof' expected near 'end' on line 9001>
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
20 Aug 2011 12:40 AM
@nate - nou

______________________________________
-ElectricBlaze,

roblox.com/my/groups.aspx?gid=372
Join today for a scripting teacher!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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