|
| 04 Aug 2013 07:20 PM |
function onXPChanged(player, XP, level) if XP.Value>=level.Value * 80 then XP.Value = XP.Value - level.Value * 5 level.Value = level.Value + 1 end end
function onLevelUp(player, XP, level) for i, player in pairs(game.Players:GetPlayers()) do local m = Instance.new("ScreenGui", player.PlayerGui) local c = Instance.new("TextLabel", m) c.BackgroundTransparency = 1 c.TextTransparency = 0 c.TextColor3 = Color3.new(255/255,255/255,255/255) c.Size = UDim2.new(0,1000,0,1050) c.TextSize = "Size14" c.Text = player.Name.." Has Leveled Up" wait(5) m:Destroy() end end function onPlayerRespawned(player) wait(5) player.Character.Humanoid.Health = player.leaderstats.Level * 20 + 20 player.Character.Humanoid.MaxHealth = player.leaderstats.Level * 20 + 20 --[[ 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 level = Instance.new("IntValue") level.Name = "Lvl" level.Value = 1
local xp = Instance.new("IntValue") xp.Name = "XP" xp.Value = 0
local gold = Instance.new("IntValue") gold.Name = "Gold" gold.Value = 50
level.Parent = stats xp.Parent = stats gold.Parent = stats
stats.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) |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Aug 2013 07:26 PM |
| I am unable to see output as the leaderboard doesn't work in roblox studio. Only in online mode. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 07:27 PM |
| Remote erroring script. Use it. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 07:35 PM |
| Text size is not a valid member of text label, Level is not a valid member of intvalue, |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 07:39 PM |
function onXPChanged(player, XP, level) if XP.Value>=level.Value * 80 then XP.Value = XP.Value - level.Value * 5 level.Value = level.Value + 1 end end
function onLevelUp(player, XP, level) for i, player in pairs(game.Players:GetPlayers()) do local m = Instance.new("ScreenGui", player.PlayerGui) local c = Instance.new("TextLabel", m) c.BackgroundTransparency = 1 c.TextTransparency = 0 c.TextColor3 = Color3.new(255/255,255/255,255/255) c.Size = UDim2.new(0,1000,0,1050) c.FontSize = "Size14" c.Text = player.Name.." Has Leveled Up" wait(5) m:Destroy() end end function onPlayerRespawned(player) wait(5) player.Character.Humanoid.Health = player.leaderstats.Level * 20 + 20 player.Character.Humanoid.MaxHealth = player.leaderstats.Level * 20 + 20 --[[ 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 level = Instance.new("IntValue") level.Name = "Lvl" level.Value = 1
local xp = Instance.new("IntValue") xp.Name = "XP" xp.Value = 0
local gold = Instance.new("IntValue") gold.Name = "Gold" gold.Value = 50
level.Parent = stats xp.Parent = stats gold.Parent = stats
stats.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)
For the second error give me a line number. |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Aug 2013 07:44 PM |
function onXPChanged(player, XP, level) if XP.Value>=level.Value * 80 then XP.Value = XP.Value - level.Value * 5 level.Value = level.Value + 1 end end
function onLevelUp(player, XP, level) for i, player in pairs(game.Players:GetPlayers()) do local m = Instance.new("ScreenGui", player.PlayerGui) local c = Instance.new("TextLabel", m) c.BackgroundTransparency = 1 c.TextTransparency = 0 c.TextColor3 = Color3.new(255/255,255/255,255/255) c.Size = UDim2.new(0,1000,0,1050) c.FontSize = "Size14" c.Text = player.Name.." Has Leveled Up" wait(5) m:Destroy() end end function onPlayerRespawned(player) wait(5) player.Character.Humanoid.Health = player.leaderstats.Level.Value * 20 + 20 player.Character.Humanoid.MaxHealth = player.leaderstats.Level.Value * 20 + 20 --[[ 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 level = Instance.new("IntValue") level.Name = "Lvl" level.Value = 1
local xp = Instance.new("IntValue") xp.Name = "XP" xp.Value = 0
local gold = Instance.new("IntValue") gold.Name = "Gold" gold.Value = 50
level.Parent = stats xp.Parent = stats gold.Parent = stats
stats.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) |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 07:51 PM |
| It works but how to I make it in the center of the screen? |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 07:52 PM |
| Get out, I am disappointed in myself due to the fact that I helped you. |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Aug 2013 07:53 PM |
| - I HATE free modelers. I am 100% against them. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 07:55 PM |
| Its one script.....I build my own games. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 07:57 PM |
| Don't care. If you want to benefit from scripts you should make them. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 07:59 PM |
| I learn how to script from other peoples scripts. |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2013 08:01 PM |
| No. You asked me to fix every issue. Learning how to script with the latter would be using it to see what works and what doesn't, then branching off from there not what you're doing. |
|
|
| Report Abuse |
|
|