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 |
|
|
|
| 20 Apr 2013 10:18 PM |
| Needs to be game.Workspace I think |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 545 |
|
|
| 30 Apr 2013 06:25 PM |
^ Oops, if Player.MP.Value == 10>=0 then |
|
|
| Report Abuse |
|
|
Maplen
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 545 |
|
|
| 30 Apr 2013 06:26 PM |
@Nicecake No, Player isn't inside Workspace. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|