|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 23 Aug 2011 06:11 PM |
Same exact problem but in output:
Workspace.Leaderboard:2: unexpected symbol near '=' |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 23 Aug 2011 06:23 PM |
It's like saying this:
a = workspace.Brick = "hello" |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|