so im trying to make a coins scoreboard, and i made it with an offline player that i dont know. (player=coins)
so i do a testfor @p[score_Coins_min=100] it doesnt work because i need to make it player specific. does any1 know how to do this?
so i do a testfor @p[score_Coins_min=100] it doesnt work because i need to make it player specific. does any1 know how to do this?
Create an account or sign in to comment.
6
1
You are using what is called a "fake player" if I'm correct. Which basically means you're assigning a score to a non-existent player. This is totally fine but it comes with some limitations.
The main limitation is that you CAN'T test for fake-player scores using normal target selectors (like @a[score_Coins_min=1].
If you did:
You can test for the score from the fake-player Example using this:
The main limitation is that you CAN'T test for fake-player scores using normal target selectors (like @a[score_Coins_min=1].
If you did:
scoreboard players set EXAMPLE Coins 1
You can test for the score from the fake-player Example using this:
scoreboard players test EXAMPLE coins 1 1
1
Ok, so basically you want to give or do something while you are testing for a command..
So, lets us visualise the basics.
Here is your coin scoreboard
/scoreboard objectives add Coins
/scoreboard objectives setdisplay Coins sidebar
Now that you have made your scoreboard,
Let us add a few points to the scoreboard.
/scoreboard players add Coins 1
If we do a repetitive command as above , you will end up using a lot of time.
The idea you have mentioned above wont work if u are making a shop.. as it is no longer supported in 1.12 plus.
So u will have to give the player a balance.
/scoreboard players add Coins 500
You could take any amount.. I'll take 500.
So now that the player has a balance..
He could fill it up again. [set a contraption for that]
Now you want to make the player teleport / buy / sell
So if you want him to teleport, make a button teleporting to the xyz coordinates.
and deduct coins from him.
/scoreboard players set Coins 450
[do the same with the shop if u make it]
OR
if you are testing for his score,
then ..
/testfor @p[score_Coins_min=1_max=100
or on a server,
/testfor @r[score_Coins_min=1_max=100]
Done!
For more help,
Subscribe to me and ya..
follow me :=]
Bye,
pyro
So, lets us visualise the basics.
Here is your coin scoreboard
/scoreboard objectives add Coins
/scoreboard objectives setdisplay Coins sidebar
Now that you have made your scoreboard,
Let us add a few points to the scoreboard.
/scoreboard players add Coins 1
If we do a repetitive command as above , you will end up using a lot of time.
The idea you have mentioned above wont work if u are making a shop.. as it is no longer supported in 1.12 plus.
So u will have to give the player a balance.
/scoreboard players add Coins 500
You could take any amount.. I'll take 500.
So now that the player has a balance..
He could fill it up again. [set a contraption for that]
Now you want to make the player teleport / buy / sell
So if you want him to teleport, make a button teleporting to the xyz coordinates.
and deduct coins from him.
/scoreboard players set Coins 450
[do the same with the shop if u make it]
OR
if you are testing for his score,
then ..
/testfor @p[score_Coins_min=1_max=100
or on a server,
/testfor @r[score_Coins_min=1_max=100]
Done!
For more help,
Subscribe to me and ya..
follow me :=]
Bye,
pyro
1
Wait so like.. are you trying to give every player a score e.g. PlayerCoins = 0?
Then I assume you get coins some how then you want to test to see if they have the required amount (100) before doing something? (e.g. /give /teleport etc.)?
If you are trying @p you will need to test the closet player you need to run the command through a command block. (Not just type it in or use the server console). On yourself (the one executing the command) use @s. Hope this helps, I'll try to be more useful when I get a better idea of what you doing :)
-Void
Then I assume you get coins some how then you want to test to see if they have the required amount (100) before doing something? (e.g. /give /teleport etc.)?
If you are trying @p you will need to test the closet player you need to run the command through a command block. (Not just type it in or use the server console). On yourself (the one executing the command) use @s. Hope this helps, I'll try to be more useful when I get a better idea of what you doing :)
-Void
1
i did the player for the color and i used the basic scoreboard commands
1
add the player to a team
and give option for color
and give option for color
1
Well I need more details. Like why did you make a player for it what is it for and commands you used to set up your coin system.