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 » Club Houses » ROBLOX Talk
Home Search
 

Re: WHY WONT THE LINES ON THIS SCRIPT WORK!!!

Previous Thread :: Next Thread 
eddz99 is not online. eddz99
Joined: 30 Dec 2009
Total Posts: 1707
11 Apr 2012 11:29 PM
function onXPChanged(player, XP, level)
if XP.Value>=level.Value * 80 and level.Value < script.LevelCap.Value then
XP.Value = XP.Value - level.Value * 80
level.Value = level.Value + 1
end
end

function onLevelUp(player, XP, level)
if player.Character~=nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = "Ball"
fireworks.formFactor = "Symmetric"
fireworks.Reflectance = 0.5
fireworks.Transparency = 0.5
fireworks.Size = Vector3.new(2,2,2)
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
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. "'s Level has been updated, Congratulations!"
wait(5)
m.Parent = nil
end

function onLevelUp(player)
wait(1)
player.leaderstats1.Defense.Value = player.leaderstats.Class.Value + 100
--[[
local stuff = player.Backpack:GetChildren()
wait(5)
for i = 1,#stuff do
local name = stuff[i].Name
if game.Starterpack:findFirstChild(name)==nil then
stuff[i]:Clone().Parent = player.Backpack
end
end
--]]
end

function onPlayerRespawned(player)
wait(2)
player.Character.Humanoid.Health = player.leaderstats1.Defense.Value + 1
player.Character.Humanoid.MaxHealth = player.leaderstats1.Defense.Value + 1
end

function onLevelUp(player)
wait(2)
player.Character.Humanoid.Health = player.leaderstats1.Defense.Value + 1
player.Character.Humanoid.MaxHealth = player.leaderstats1.Defense.Value + 1
--[[
local stuff = player.Backpack:GetChildren()
wait(5)
for i = 1,#stuff do
local name = stuff[i].Name
if game.Starterpack:findFirstChild(name)==nil then
stuff[i]:Clone().Parent = player.Backpack
end
end
--]]
end

function onLevelUp(player)
wait(1)
player.leaderstats1.Skillpts.Value = player.leaderstats.Lvl.Value + 1
--[[
local stuff = player.Backpack:GetChildren()
wait(5)
for i = 1,#stuff do
local name = stuff[i].Name
if game.Starterpack:findFirstChild(name)==nil then
stuff[i]:Clone().Parent = player.Backpack
end
end
--]]
end


function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"

local stats1 = Instance.new("IntValue")
stats1.Name = "leaderstats1"

local level = Instance.new("IntValue")
level.Name = "Lvl"
level.Value = 20

local xp = Instance.new("IntValue")
xp.Name = "XP"
xp.Value = 0

local gold = Instance.new("IntValue")
gold.Name = "Gold"
gold.Value = 20

local Fantasy = Instance.new("IntValue")
Fantasy.Name = "Class"
Fantasy.Value = 0

local Defense = Instance.new("IntValue")
Defense.Name = "Defense"
Defense.Value = 0

local Statpts = Instance.new("IntValue")
Statpts.Name = "Skillpoints"
Statpts.Value = 0

level.Parent = stats
xp.Parent = stats
gold.Parent = stats
Fantasy.Parent = stats

Defense.Parent = stats1
Statpts.Parent = stats1

stats.Parent = newPlayer
stats1.Parent = newPlayer

xp.Changed:connect(function() onXPChanged(newPlayer, xp, level) end)
level.Changed:connect(function() onLevelUp(newPlayer, xp, level) end)

newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end

game.Players.ChildAdded:connect(onPlayerEntered)

THESE WONT WORK:

function onLevelUp(player)
wait(1)
player.leaderstats1.Skillpts.Value = player.leaderstats.Lvl.Value + 1

function onLevelUp(player)
wait(2)
player.Character.Humanoid.Health = player.leaderstats1.Defense.Value + 1
player.Character.Humanoid.MaxHealth = player.leaderstats1.Defense.Value + 1

function onLevelUp(player)
wait(1)
player.leaderstats1.Defense.Value = player.leaderstats.Class.Value + 100
Report Abuse
Dentists is not online. Dentists
Joined: 09 Apr 2012
Total Posts: 6624
11 Apr 2012 11:29 PM
Wrong forum, yes?
Report Abuse
Justyourregularnoob is not online. Justyourregularnoob
Joined: 24 Feb 2011
Total Posts: 5439
11 Apr 2012 11:30 PM
wat da hell do all these jumbled words and numbers do
Report Abuse
nvva is not online. nvva
Joined: 21 Mar 2012
Total Posts: 388
11 Apr 2012 11:30 PM
OT lMaD
Report Abuse
wowzee is not online. wowzee
Joined: 02 Apr 2010
Total Posts: 22692
11 Apr 2012 11:31 PM
I really can't say, you will have much more help if you go to scripting helpers.
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
11 Apr 2012 11:39 PM
You didn't declare the variable 'XP'
Report Abuse
l3oomHeadShawt is not online. l3oomHeadShawt
Joined: 10 Apr 2012
Total Posts: 71
11 Apr 2012 11:41 PM
wat? what does it even do?
Report Abuse
eddz99 is not online. eddz99
Joined: 30 Dec 2009
Total Posts: 1707
11 Apr 2012 11:45 PM
function onXPChanged(player, XP, level)
if XP.Value>=level.Value * 80 and level.Value < script.LevelCap.Value then
XP.Value = XP.Value - level.Value * 80
level.Value = level.Value + 1
end
end

function onLevelUp(player, XP, level)
if player.Character~=nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = "Ball"
fireworks.formFactor = "Symmetric"
fireworks.Reflectance = 0.5
fireworks.Transparency = 0.5
fireworks.Size = Vector3.new(2,2,2)
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
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. "'s Level has been updated, Congratulations!"
wait(5)
m.Parent = nil
end

function onPlayerRespawned(player)
wait(2)
player.Character.Humanoid.Health = player.leaderstats1.Defense.Value + 1
player.Character.Humanoid.MaxHealth = player.leaderstats1.Defense.Value + 1
end

player.XP.Changed:connect(function()
wait(1)
player.leaderstats1.Skillpts.Value = player.leaderstats.Lvl.Value + 1
player.Character.Humanoid.Health = player.leaderstats1.Defense.Value + 1
player.Character.Humanoid.MaxHealth = player.leaderstats1.Defense.Value + 1
end)

function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"

local stats1 = Instance.new("IntValue")
stats1.Name = "leaderstats1"

local level = Instance.new("IntValue")
level.Name = "Lvl"
level.Value = 20

local xp = Instance.new("IntValue")
xp.Name = "XP"
xp.Value = 0

local gold = Instance.new("IntValue")
gold.Name = "Gold"
gold.Value = 20

local Fantasy = Instance.new("IntValue")
Fantasy.Name = "Class"
Fantasy.Value = 0

local Defense = Instance.new("IntValue")
Defense.Name = "Defense"
Defense.Value = 0

local Statpts = Instance.new("IntValue")
Statpts.Name = "Skillpoints"
Statpts.Value = 0

level.Parent = stats
xp.Parent = stats
gold.Parent = stats
Fantasy.Parent = stats

Defense.Parent = stats1
Statpts.Parent = stats1

stats.Parent = newPlayer
stats1.Parent = newPlayer

xp.Changed:connect(function() onXPChanged(newPlayer, xp, level) end)
level.Changed:connect(function() onLevelUp(newPlayer, xp, level) end)

newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end

game.Players.ChildAdded:connect(onPlayerEntered)


Doesnt work
Report Abuse
eddz99 is not online. eddz99
Joined: 30 Dec 2009
Total Posts: 1707
11 Apr 2012 11:46 PM
function onXPChanged(player, XP, level)
if XP.Value>=level.Value * 80 and level.Value < script.LevelCap.Value then
XP.Value = XP.Value - level.Value * 80
level.Value = level.Value + 1
end
end

function onLevelUp(player, XP, level)
if player.Character~=nil then
for i = 1,5 do
local fireworks = Instance.new("Part")
fireworks.Shape = "Ball"
fireworks.formFactor = "Symmetric"
fireworks.Reflectance = 0.5
fireworks.Transparency = 0.5
fireworks.Size = Vector3.new(2,2,2)
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
end
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = player.Name .. "'s Level has been updated, Congratulations!"
wait(5)
m.Parent = nil
end

function onPlayerRespawned(player)
wait(2)
player.Character.Humanoid.Health = player.leaderstats1.Defense.Value + 1
player.Character.Humanoid.MaxHealth = player.leaderstats1.Defense.Value + 1
end

player.XP.Changed:connect(function()
wait(1)
player.leaderstats1.Skillpts.Value = player.leaderstats.Lvl.Value + 1
player.Character.Humanoid.Health = player.leaderstats1.Defense.Value + 1
player.Character.Humanoid.MaxHealth = player.leaderstats1.Defense.Value + 1
end)

function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"

local stats1 = Instance.new("IntValue")
stats1.Name = "leaderstats1"

local level = Instance.new("IntValue")
level.Name = "Lvl"
level.Value = 20

local xp = Instance.new("IntValue")
xp.Name = "XP"
xp.Value = 0

local gold = Instance.new("IntValue")
gold.Name = "Gold"
gold.Value = 20

local Fantasy = Instance.new("IntValue")
Fantasy.Name = "Class"
Fantasy.Value = 0

local Defense = Instance.new("IntValue")
Defense.Name = "Defense"
Defense.Value = 0

local Statpts = Instance.new("IntValue")
Statpts.Name = "Skillpoints"
Statpts.Value = 0

level.Parent = stats
xp.Parent = stats
gold.Parent = stats
Fantasy.Parent = stats

Defense.Parent = stats1
Statpts.Parent = stats1

stats.Parent = newPlayer
stats1.Parent = newPlayer

xp.Changed:connect(function() onXPChanged(newPlayer, xp, level) end)
level.Changed:connect(function() onLevelUp(newPlayer, xp, level) end)

newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end

game.Players.ChildAdded:connect(onPlayerEntered)

still dont work :o
Report Abuse
batsleep is not online. batsleep
Joined: 01 Feb 2009
Total Posts: 13677
11 Apr 2012 11:46 PM
[ Content Deleted ]
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
11 Apr 2012 11:47 PM
You never declared common variables...
Report Abuse
ReturnOfKhoraski is not online. ReturnOfKhoraski
Joined: 10 Apr 2012
Total Posts: 54
11 Apr 2012 11:48 PM
[ Content Deleted ]
Report Abuse
eddz99 is not online. eddz99
Joined: 30 Dec 2009
Total Posts: 1707
11 Apr 2012 11:49 PM
function player.XP.Changed:connect(function()
wait(1)
player.leaderstats1.Skillpts.Value = player.leaderstats.Lvl.Value + 1
player.Character.Humanoid.Health = player.leaderstats1.Defense.Value + 1
player.Character.Humanoid.MaxHealth = player.leaderstats1.Defense.Value + 1
end

????
Report Abuse
ReturnOfKhoraski is not online. ReturnOfKhoraski
Joined: 10 Apr 2012
Total Posts: 54
11 Apr 2012 11:51 PM
[ Content Deleted ]
Report Abuse
eddz99 is not online. eddz99
Joined: 30 Dec 2009
Total Posts: 1707
11 Apr 2012 11:52 PM
@ret

y?
Report Abuse
ReturnOfKhoraski is not online. ReturnOfKhoraski
Joined: 10 Apr 2012
Total Posts: 54
11 Apr 2012 11:55 PM
[ Content Deleted ]
Report Abuse
eddz99 is not online. eddz99
Joined: 30 Dec 2009
Total Posts: 1707
11 Apr 2012 11:57 PM
@ret
just enjyoing my youth o.o
Report Abuse
nicetherock3 is not online. nicetherock3
Joined: 30 Oct 2010
Total Posts: 578
11 Apr 2012 11:59 PM
you on to much yes?
Report Abuse
eddz99 is not online. eddz99
Joined: 30 Dec 2009
Total Posts: 1707
12 Apr 2012 12:01 AM
wut?
Report Abuse
ventus48539 is not online. ventus48539
Joined: 09 Oct 2011
Total Posts: 115277
12 Apr 2012 12:11 AM
[ Content Deleted ]
Report Abuse
Fortone is not online. Fortone
Joined: 19 Mar 2012
Total Posts: 6332
12 Apr 2012 12:12 AM
Wrong section.
Report Abuse
eddz99 is not online. eddz99
Joined: 30 Dec 2009
Total Posts: 1707
12 Apr 2012 09:15 PM
.
Report Abuse
eddz99 is not online. eddz99
Joined: 30 Dec 2009
Total Posts: 1707
14 Apr 2012 10:55 AM
o.o
Report Abuse
BestServedCold is not online. BestServedCold
Joined: 24 Oct 2011
Total Posts: 791
14 Apr 2012 10:56 AM
Way to steal RME's script o.o
Report Abuse
LuAManual is not online. LuAManual
Joined: 02 Apr 2012
Total Posts: 1238
14 Apr 2012 10:57 AM
u forgot a space somewhere....

derp
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » ROBLOX Talk
   
 
   
  • 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