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: Constantly saying its not a member of ObjectValue

Previous Thread :: Next Thread 
Nexx is not online. 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 is not online. Nexx
Joined: 20 Jul 2008
Total Posts: 853
26 Nov 2013 12:41 PM
help pls
Report Abuse
einsteinK is not online. 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 is not online. Flingi2
Joined: 29 Dec 2008
Total Posts: 221
26 Nov 2013 04:55 PM
KEwl
Report Abuse
bobbybobboo is not online. bobbybobboo
Joined: 19 Mar 2011
Total Posts: 34
26 Nov 2013 05:11 PM
I stalk you...
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