Nexx
|
  |
| Joined: 20 Jul 2008 |
| Total Posts: 853 |
|
|
| 26 Nov 2013 11:34 AM |
In the script below i made, the user resets back to the normal menu after a battle, but it seems to get stuck at the part when it calculates the experience at the local newEXP. It keeps saying that
StartBP is not a member of Object value, when it clearly is. Is there a reason it keeps telling me this?
function playerEnd(player, enemy, battle) -- remove gui cards from field, and clean up the field for i,v in pairs(player.PlayerGui.Battle.Field:getChildren()) do if(v.Name == 'Character' or v.Name == 'Gear') then v:remove() end end player.PlayerGui.Lobby.Main.Visible = true player.PlayerGui.Lobby.MouseDetect.Visible = true player.PlayerGui.Lobby.Main.Body.Home.Visible = true player.PlayerGui.Lobby.Main.Body.Challenge.Visible = false player.PlayerGui.Battle.Field.Visible = false player.PlayerGui.Battle.Stats.Visible = false player.PlayerGui.Battle.User.Visible = false player.PlayerGui.Battle.Chat.Visible = false player.PlayerGui.Battle.MouseDetect.Visible = false if(enemy ~= nil) then eneLevel = enemy.Rank.Value else eneLevel = 1 end
-- this is the line local newEXP = calcWinExp(battle.StartBP.Value, battle[player.Location.Enemy.Value].BP.Value, eneLevel, player.Rank.Value)
player.EXP.Value = player.EXP.Value+newEXP if(player.EXP.Value >= player.EXP.MaxEXP.Value) then player.EXP.Value = player.EXP.Value - player.EXP.MaxEXP.Value player.Rank.Value = player.Rank.Value + 1 player.EXP.MaxEXP.Value = calcLevel(player.Rank.Value) end wait(1) battle:remove() end |
|
|
| Report Abuse |
|
Nexx
|
  |
| Joined: 20 Jul 2008 |
| Total Posts: 853 |
|
| |
einsteinK
|
  |
| Joined: 22 May 2011 |
| Total Posts: 1015 |
|
|
| 26 Nov 2013 12:45 PM |
| The line that calls playerEnd() passes on a wrong argument for battle |
|
|
| Report Abuse |
|
Flingi2
|
  |
| Joined: 29 Dec 2008 |
| Total Posts: 221 |
|
| |
| |