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
 

MP bar tool

Previous Thread :: Next Thread 
Maplen is not online. Maplen
Joined: 19 Sep 2012
Total Posts: 545
20 Apr 2013 09:37 PM
Players.Player1.Backpack.MP.Script:3: 'then' expected near '='
That is the output

This is the script :

function Magic()
Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
if Player.MP.Value = 10>=0 then
Player.MP.Value = Player.MP.Value -10
wait()
end
end

script.Parent.Activated:connect(MP)
Report Abuse
NiceCake123 is not online. NiceCake123
Joined: 24 Dec 2011
Total Posts: 972
20 Apr 2013 10:18 PM
Needs to be game.Workspace I think
Report Abuse
BrandonFireflower is not online. BrandonFireflower
Joined: 09 Feb 2010
Total Posts: 731
20 Apr 2013 10:41 PM
This line: if Player.MP.Value = 10>=0 then

I do not know what you are trying to do there, but you're setting a value and comparing it at the same time. That won't work.
Report Abuse
Maplen is not online. Maplen
Joined: 19 Sep 2012
Total Posts: 545
30 Apr 2013 06:25 PM
^
Oops, if Player.MP.Value == 10>=0 then
Report Abuse
Maplen is not online. Maplen
Joined: 19 Sep 2012
Total Posts: 545
30 Apr 2013 06:26 PM
@Nicecake
No, Player isn't inside Workspace.
Report Abuse
Maplen is not online. Maplen
Joined: 19 Sep 2012
Total Posts: 545
30 Apr 2013 06:46 PM
Would I put the Value here?
Output reads: Unexpected Symbol near '>'

1.function Magic()
2.Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
3.
4.print ("Running MPTool")
5.
6.if Player.Magic.Value == >100 then
7.Player.Magic.Value = Player.Magic.Value -10
8.wait()
9.end
10.end
11.
12.script.Parent.Activated:connect(Magic)
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
30 Apr 2013 06:49 PM
function Magic()
Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
if Player.MP.Value == 10 and Player.MP.Value>=0 then
Player.MP.Value = Player.MP.Value -10
wait()
end
end

script.Parent.Activated:connect(MP)
Report Abuse
Maplen is not online. Maplen
Joined: 19 Sep 2012
Total Posts: 545
30 Apr 2013 06:53 PM
You're doing what I did on my error.
Comparing/Setting bool with number. Also there isn't anything there with the unexpected.
Report Abuse
Maplen is not online. Maplen
Joined: 19 Sep 2012
Total Posts: 545
30 Apr 2013 06:54 PM
It says it is an attempt to call a nil value
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
30 Apr 2013 06:56 PM
If that's happening, Player.Mp.Value is a Bool Value .-.
You also didn't do the connection line right...

function Magic()
Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
if Player.MP.Value == 10 and Player.MP.Value>=0 then
Player.MP.Value = Player.MP.Value -10
wait()
end
end

script.Parent.Activated:connect(Magic)
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