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: What am I doing wrong?

Previous Thread :: Next Thread 
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 11:13 AM
This script is inside the normal ROBLOX leader board script, although the leader board doesn't have captures.

if kills.Value=>4 then
game.Lighting.LevelUp.MahjongSword:clone().Parent=newPlayer.Backpack
end

if kills.Value=>9 then
game.Lighting.LevelUp.OrcBlade:clone().Parent=newPlayer.Backpack
end

if Level.Value=>14 then
game.Lighting.LevelUp.PhoenixAxe:clone().Parent=newPlayer.Backpack
end

if Level.Value=>24 then
game.Lighting.LevelUp.8BitSword:clone().Parent=newPlayer.Backpack
end

if kills.Value=>34 then
game.Lighting.LevelUp.DragonHunterSpear:clone().Parent=newPlayer.Backpack
end

if kills.Value=>44 then
game.Lighting.LevelUp.FireBrand:clone().Parent=newPlayer.Backpack
end

if kills.Value=>64 then
game.Lighting.LevelUp.IceSword:clone().Parent=newPlayer.Backpack
end

if kills.Value=>84 then
game.Lighting.LevelUp.ZombieAxe:clone().Parent=newPlayer.Backpack
end

if kills.Value=>104 then
game.Lighting.LevelUp.GrimAxe:clone().Parent=newPlayer.Backpack
end

if kills.Value=>134 then
game.Lighting.LevelUp.PhoenixClub:clone().Parent=newPlayer.Backpack
end

if kills.Value=>164 then
game.Lighting.LevelUp.IceHammer:clone().Parent=newPlayer.Backpack
end

if kills.Value=>194 then
game.Lighting.LevelUp.WindSword:clone().Parent=newPlayer.Backpack
end

if kills.Value=>234 then
game.Lighting.LevelUp.SuperKatana:clone().Parent=newPlayer.Backpack
end

if kills.Value=>274 then
game.Lighting.LevelUp.PhoenixSword:clone().Parent=newPlayer.Backpack
end

if kills.Value=>314 then
game.Lighting.LevelUp.InfernoSword:clone().Parent=newPlayer.Backpack
end
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
11 Mar 2013 11:16 AM
What exactly is your problem? I only see very ugly script, and that's it.
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
11 Mar 2013 11:21 AM
[ Content Deleted ]
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 11:28 AM
It's not doing what it's supposed to do, which is give players different swords when the get enough kills.
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 11:34 AM
Bump.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
11 Mar 2013 11:38 AM
Now we are talking...


Levels = {4 = "MahjongSword",9 = "OrcBlade",14 = "PhoenixAxe",24 = "8BitSword",34 = "DragonHunterSpear",44 = "FireBrand",64 = "IceSword",84 = "ZombieAxe",104 = "GrimAxe",134 = "PhoenixClub",164 = "IceHammer",194 = "WindSword",234 = "SuperKatana",274 = "PhoenixSword",314 = "InfernoSword"}

kills.Changed:connect(function()
local sword;
for num, obj in pairs(Levels) do
if kills.Value >= num then
sword = obj
end
end
if sword then
if not newPlayer.Backpack:FindFirstChild(sword) then
game.Lighting.LevelUp[sword]:Clone().Parent = newPlayer.Backpack
end
end
end)

Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 11:40 AM
Thank you. I'll try it out now.
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 11:49 AM
The output said:

12:48:04.150 - Workspace.LeaderboardV3.Script:1: '}' expected near '='
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 11:57 AM
Bump.
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
11 Mar 2013 12:00 PM
@noone
In the horrid script you posted, you switched the conditional operators around.

You need to do this: >= instead of =>
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 12:09 PM
Oh. Thanks.
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 01:34 PM
So it should work if I switch them?
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
11 Mar 2013 01:42 PM
There's a thing called testing.
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 02:17 PM
Which I've been doing.
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 02:21 PM
15:21:05.636 - Workspace.LeaderboardV3.Script:1: attempt to index global 'kills' (a nil value)
15:21:05.637 - Script "Workspace.LeaderboardV3.Script", Line 1
15:21:05.637 - stack end
Report Abuse
nightmare3o is not online. nightmare3o
Joined: 21 Jun 2008
Total Posts: 956
11 Mar 2013 02:22 PM
Looks like "kills" doesn't exist :|
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 02:29 PM
I guess not.
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 02:33 PM
I put in a LocalScript rather than a global script. Now there's no errors from the output but it still doesn't work.
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 02:59 PM
Bump.
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
11 Mar 2013 03:51 PM
put this in a localscript


Levels = {4 = "MahjongSword";
9 = "OrcBlade";
14 = "PhoenixAxe";
24 = "8BitSword";
34 = "DragonHunterSpear";
44 = "FireBrand";
64 = "IceSword";
84 = "ZombieAxe";
104 = "GrimAxe";
134 = "PhoenixClub";
164 = "IceHammer";
194 = "WindSword";
234 = "SuperKatana";
274 = "PhoenixSword";
314 = "InfernoSword"}

game.Players.LocalPlayer.leaderstats.kills.Changed:connect(function()
local sword;
for num, obj in pairs(Levels) do
if kills.Value >= num then
sword = obj
end
end
if sword then
if not newPlayer.Backpack:FindFirstChild(sword) then
game.Lighting.LevelUp[sword]:Clone().Parent = newPlayer.Backpack
end
end
end)
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 03:57 PM
Should the LocalScript a child of the leaderboard script?
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
11 Mar 2013 04:02 PM
@lolb. Nay, numbers doesn't work laik datin tables QQ


Here, tried to fix mine:

Levels = {}
Levels[4] = "MahjongSword"
Levels[9] = "OrcBlade"
Levels[14] = "PhoenixAxe"
Levels[24] = "8BitSword"
Levels[34] = "DragonHunterSpear"
Levels[44] = "FireBrand"
Levels[64] = "IceSword"
Levels[84] = "ZombieAxe"
Levels[104] = "GrimAxe"
Levels[134] = "PhoenixClub"
Levels[164] = "IceHammer"
Levels[194] = "WindSword"
Levels[234] = "SuperKatana"
Levels[274] = "PhoenixSword"
Levels[314] = "InfernoSword"

kills.Changed:connect(function()
local sword;
for num, obj in pairs(Levels) do
if kills.Value >= num then
sword = obj
end
end
if sword then
if not newPlayer.Backpack:FindFirstChild(sword) then
game.Lighting.LevelUp[sword]:Clone().Parent = newPlayer.Backpack
end
end
end)
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 05:51 PM
Kills is still a nil value.
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 07:45 PM
If it's in a LocalScript.
Report Abuse
noone334 is not online. noone334
Joined: 02 Aug 2011
Total Posts: 2454
11 Mar 2013 07:54 PM
I meant if it's not in a LocalScript.
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