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: Leaderboard not Working Properly?

Previous Thread :: Next Thread 
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
23 Aug 2011 05:51 PM
It starts you at Lvl. 0 and It's making the .Changed function not work, since zero times any number is zero. I thought I had this working, but I guess not. .-.


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 .. " upgraded one level! :D"
wait(3)
m.Parent = nil
end
end
end)
end
game.Players.ChildAdded:connect(onPlayerEntered)
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
23 Aug 2011 05:59 PM
Someone?
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
23 Aug 2011 06:06 PM
-Sigh-

Please don't post scripts longer then 20 lines with no description, nor any output and just say 'fix it'. Anyways, lemme try and fix it since majority of the people here are probably too lazy.


game.Players.PlayerAdded:connect(function(player)
local a = Instance.new("IntValue", player).Name = "leaderstats"

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

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

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

c.Changed:connect(function()
if c.Value >= b.Value * 150 then
c.Value = c.Value - b.Value * 150
b.Value = b.Value+1
if workspace:findFirstChild(p.Name) 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", workspace).Text = player.Name.." upgraded one level! :D"
game:GetService("Debris"):AddItem(m, 3)
end
end
end)
end)

Try that?

--Still too lazy to look through whole script but whatever--


Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
23 Aug 2011 06:11 PM
Same exact problem but in output:

Workspace.Leaderboard:2: unexpected symbol near '='
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
23 Aug 2011 06:13 PM
Well, I don't see anything wrong in the first part, and I'm didn't see much in the bottom either. Meh..Maybe I'm just too tired to help today.
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
23 Aug 2011 06:15 PM
delta NUUUUUU!
(Bump)
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
23 Aug 2011 06:19 PM
"local a = Instance.new("IntValue", player).Name = "leaderstats""

When setting a variable, you can't do that. You must do it like this:

local a = Instance.new("IntValue", player)
a.Name = "leaderstats"

OR

Instance.new("IntValue", player).Name = "leaderstats"
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
23 Aug 2011 06:20 PM
You do?!!!? NUUU. Sigh. -Goes to my admin commands and changes it a bagillion times- Why must chu ruin eet all. x.x
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
23 Aug 2011 06:23 PM
It's like saying this:

a = workspace.Brick = "hello"
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
23 Aug 2011 06:27 PM
Sorry, I took so long. Ok so I fixed it got another output, fixed it, but now it still doesn't work. And no output this time. This is the new version:

game.Players.PlayerAdded:connect(function(player)
local a = Instance.new("IntValue", player)
a.Name = "leaderstats"

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

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

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

c.Changed:connect(function()
if c.Value >= b.Value * 150 then
c.Value = c.Value - b.Value * 150
b.Value = b.Value+1
if workspace:findFirstChild(p.Name) 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", workspace)
m.Text = player.Name.." upgraded one level! :D"
game:GetService("Debris"):AddItem(m, 3)
end
end
end)
end)
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
23 Aug 2011 06:33 PM
It starts you at Lvl. 0 and the .Changed function is not working either. No output. Someone pelase help!
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
23 Aug 2011 06:36 PM
Found the problem... My DP script was breaking it for some reason and now my sword is broken. WHAT IS WRONG WITH MY SCRIPTS! D:< RAGEEE!
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