Roblox Central

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Roblox Central

Discussion for all things Roblox. (roblox.com)

Welcome to the new forum! Any suggestions you have are greatly appreciated.
WARNING: Before referring anyone to this website, Please read this topic

4 posters

    I see nothing wrong.

    iMathRandom
    iMathRandom
    Mod


    Posts : 66
    Join date : 2009-06-21
    Location : Ohio

    I see nothing wrong. Empty I see nothing wrong.

    Post by iMathRandom Mon Sep 28, 2009 7:22 am

    e gives it's values to Exp if AwardExp is true, but it doesn't work.


    Code:

    while (AwardExp) and e.Value>0 do
    wait(.01)
    Texp.Value=Texp.Value+1
    Exp.Value=Exp.Value+1
    e.Value=e.Value-1
    end

    if Exp.Value==ToNextLevel.Value then
    AwardExp = false
    Exp.Value=0
    if lvl.Value<=10 then
    lvl.Value=lvl.Value+1
    MaxHP.Value=MaxHP.Value+math.random(1, 8)
    stg.Value=stg.Value+math.random(1, 5)
    def.Value=def.Value+math.random(1, 5)
    spd.Value=spd.Value+math.random(1, 5)
    mag.Value=mag.Value+math.random(1, 5)
    elseif lvl.Value<= 11 and lvl.Value>=30 then
    lvl.Value=lvl.Value+1
    MaxHP.Value=MaxHP.Value+math.random(1, 6)
    stg.Value=stg.Value+math.random(1, 3)
    def.Value=def.Value+math.random(1, 3)
    spd.Value=spd.Value+math.random(1, 3)
    mag.Value=mag.Value+math.random(1, 3)
    else
    lvl.Value=lvl.Value+1
    MaxHP.Value=MaxHP.Value+math.random(1, 4)
    stg.Value=stg.Value+math.random(1, 2)
    def.Value=def.Value+math.random(1, 2)
    spd.Value=spd.Value+math.random(1, 2)
    mag.Value=mag.Value+math.random(1, 2)
    end
    wait(2)
    AwardExp=true
    end
    Earth
    Earth
    Admin


    Posts : 402
    Join date : 2009-06-18
    Location : According to my IP address: Topeka, Kansas.

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by Earth Mon Sep 28, 2009 4:44 pm

    What should this do.
    avatar
    Jfeather
    Admin


    Posts : 232
    Join date : 2009-06-18
    Location : This Forum. Duh.

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by Jfeather Tue Sep 29, 2009 5:41 am

    Move the end after the While True Do function to the very end of the script. There is nothing running the "If" function, if I'm thinking correctly right now.
    iMathRandom
    iMathRandom
    Mod


    Posts : 66
    Join date : 2009-06-21
    Location : Ohio

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by iMathRandom Tue Sep 29, 2009 3:16 pm

    Earth wrote:What should this do.

    It's a leveling up system. I'm going to use a GUI for exp so you can see it go up. Once you level up, you get to see what stats went up (later)then resets the exp and continue to add the remainning exp. e is where exp points go. If e Has 1 or more values then it will add it' values to Exp.


    @JFeather, wouldn't when somebody levels up their stats will continue to go up?
    Earth
    Earth
    Admin


    Posts : 402
    Join date : 2009-06-18
    Location : According to my IP address: Topeka, Kansas.

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by Earth Tue Sep 29, 2009 4:36 pm

    It looks to like it adds Xp as you live...
    iMathRandom
    iMathRandom
    Mod


    Posts : 66
    Join date : 2009-06-21
    Location : Ohio

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by iMathRandom Tue Sep 29, 2009 6:28 pm

    @ Jfeather, it didn't work, plus I made additions to it. Here's the full script now.

    Code:

    game.Players.ChildAdded:connect(function(p)


    --Stats, Materials, and other Values--


    stats=Instance.new"IntValue" stats.Parent=p stats.Name="Stats"
    lvl=Instance.new"IntValue" lvl.Parent=stats lvl.Name="Level" lvl.Value=1
    MaxHP=Instance.new"IntValue" MaxHP.Parent=stats MaxHP.Name="MaxHP" MaxHP.Value=100
    gold=Instance.new"IntValue" gold.Parent=stats gold.Name="Gold" gold.Value=0
    Texp=Instance.new"IntValue" Texp.Parent=stats Texp.Name="Total Experience" Texp.Value=0
    Exp=Instance.new"IntValue" Exp.Parent=stats Exp.Name="Experience" Exp.Value=0
       AwardExp=Instance.new"BoolValue" AwardExp.Parent=Exp AwardExp.Name="AwardExp"
       e=Instance.new"IntValue" e.Parent=stats e.Name="e" e.Value=0
    ToNextLevel=Instance.new"IntValue" ToNextLevel.Parent=stats ToNextLevel.Name="TNL" ToNextLevel.Value=100
    stg=Instance.new"IntValue" stg.Parent=stats stg.Name="Strenght" stg.Value=1
    def=Instance.new"IntValue" def.Parent=stats def.Name="Defence" def.Value=1
    mag=Instance.new"IntValue" mag.Parent=stats mag.Name="Magic" mag.Value=1
    mp=Instance.new"IntValue" mp.Parent=stats mp.Name="Magic Power" mp.Value=10


    HUWA=Instance.new"BoolValue" HUWA.Parent=p HUWA.Name="HUWA" --Has Underwater Abillities
    Drown=Instance.new"BoolValue" Drown.Parent=HUWA Drown.Name="Drown" Drown.Value=true


    --Spawing Points--


    s=Instance.new"Vector3Value" s.Parent=p s.Name="Spawn" s.Value=Vector3.new(37.5, 3, -7)
    p.Changed:connect(function(n)
    if (n=="Character") and p.Character~=nil then
    p.Character.Humanoid.WalkSpeed=0
    m=Instance.new"Message"
    m.Parent=p
    m.Text=[[Please select the "Game Tool".]]
    end
    end)


    --Award Experience & Leveling Up--


    if e.Value>0 then
    AwardExp.Value=true
    else
    AwardExp.Value=false
    end
    while (AwardExp.Value) do
    wait(.01)
    Texp.Value=Texp.Value+1
    Exp.Value=Exp.Value+1
    e.Value=e.Value-1
    end

    if Exp.Value==ToNextLevel.Value then
    AwardExp.Value=false
    Exp.Value=0
    if lvl.Value<=10 then
    lvl.Value=lvl.Value+1
    MaxHP.Value=MaxHP.Value+math.random(1, 8)
    stg.Value=stg.Value+math.random(1, 5)
    def.Value=def.Value+math.random(1, 5)
    spd.Value=spd.Value+math.random(1, 5)
    mag.Value=mag.Value+math.random(1, 5)
    elseif lvl.Value<= 11 and lvl.Value>=30 then
    lvl.Value=lvl.Value+1
    MaxHP.Value=MaxHP.Value+math.random(1, 6)
    stg.Value=stg.Value+math.random(1, 3)
    def.Value=def.Value+math.random(1, 3)
    spd.Value=spd.Value+math.random(1, 3)
    mag.Value=mag.Value+math.random(1, 3)
    else
    lvl.Value=lvl.Value+1
    MaxHP.Value=MaxHP.Value+math.random(1, 4)
    stg.Value=stg.Value+math.random(1, 2)
    def.Value=def.Value+math.random(1, 2)
    spd.Value=spd.Value+math.random(1, 2)
    mag.Value=mag.Value+math.random(1, 2)
    end
    wait(2)
    AwardExp.Value=true
    end




    end)
    Meelo
    Meelo
    Admin


    Posts : 217
    Join date : 2009-06-19

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by Meelo Tue Sep 29, 2009 7:05 pm

    Add to the start:

    script:Work()
    Earth
    Earth
    Admin


    Posts : 402
    Join date : 2009-06-18
    Location : According to my IP address: Topeka, Kansas.

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by Earth Wed Sep 30, 2009 3:53 pm

    If only meelo... If only...
    Meelo
    Meelo
    Admin


    Posts : 217
    Join date : 2009-06-19

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by Meelo Wed Sep 30, 2009 4:54 pm

    Earth wrote:If only meelo... If only...
    It doesn't work? *Kicks 'Lua for Dummies'*
    iMathRandom
    iMathRandom
    Mod


    Posts : 66
    Join date : 2009-06-21
    Location : Ohio

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by iMathRandom Thu Oct 01, 2009 6:06 am

    I finallly figured it out.

    Code:

    while true do
    wait(0.000000000000000000001)

    if Exp.Value==ToNextLevel.Value then
    AwardExp = false
    ToNextLevel.Value=(ToNextLevel.Value*15/100) + ToNextLevel.Value
    Exp.Value=0
    if lvl.Value<=10 then
    lvl.Value=lvl.Value+1
    MaxHP.Value=MaxHP.Value+math.random(1, 8)
    stg.Value=stg.Value+math.random(1, 5)
    def.Value=def.Value+math.random(1, 5)
    mag.Value=mag.Value+math.random(1, 5)
    elseif lvl.Value<= 11 and lvl.Value>=30 then
    lvl.Value=lvl.Value+1
    MaxHP.Value=MaxHP.Value+math.random(1, 6)
    stg.Value=stg.Value+math.random(1, 3)
    def.Value=def.Value+math.random(1, 3)
    mag.Value=mag.Value+math.random(1, 3)
    else
    lvl.Value=lvl.Value+1
    MaxHP.Value=MaxHP.Value+math.random(1, 4)
    stg.Value=stg.Value+math.random(1, 2)
    def.Value=def.Value+math.random(1, 2)
    mag.Value=mag.Value+math.random(1, 2)
    end
    wait(2)
    AwardExp=true
    end
    if (AwardExp) and e.Value>0 then
    wait(.000000000001)
    Texp.Value=Texp.Value+1
    Exp.Value=Exp.Value+1
    e.Value=e.Value-1
    end
    end
    Earth
    Earth
    Admin


    Posts : 402
    Join date : 2009-06-18
    Location : According to my IP address: Topeka, Kansas.

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by Earth Thu Oct 01, 2009 1:20 pm

    That wait is uglay.

    smallest wait is like 0.03 or something.
    iMathRandom
    iMathRandom
    Mod


    Posts : 66
    Join date : 2009-06-21
    Location : Ohio

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by iMathRandom Thu Oct 01, 2009 1:35 pm

    Earth wrote:That wait is uglay.

    smallest wait is like 0.03 or something.

    But it works so =P
    iMathRandom
    iMathRandom
    Mod


    Posts : 66
    Join date : 2009-06-21
    Location : Ohio

    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by iMathRandom Thu Oct 01, 2009 1:35 pm

    Earth wrote:That wait is uglay.

    smallest wait is like 0.03 or something.

    But it works so =P

    Sponsored content


    I see nothing wrong. Empty Re: I see nothing wrong.

    Post by Sponsored content


      Current date/time is Fri Apr 26, 2024 11:11 am