I have a turn-based strategy game that I want to highlight (meaning: change the brick color of) certain squares (parts) based on whether a selected (clicked) piece can move there. However, with one board, the pieces are highlighted for both players. I'd rather not make two copies of the board so that I can manipulate them independently, as I'd have to keep track of all the piece moves and copy them to both boards.
Here's a chess example that should be analogous to my game enough for this question: Player 1 clicks a bishop to move it and all the squares diagonal to it not blocked by other pieces are highlighted, but player 2 sees the now-highlighted squares as normal. How do i do this?
Any ideas? Suggestions?
If you have FilteringEnabled
on, then you could use localscripts
to make changes to everything inside of the workspace locally, which means only that player will see it. EnableFilteringEnabled
by clicking on workspace and look into its properties and you would findFilteringEnabled
. Keep in mind with it enabled all communication between client and server
should be made through RemoteFunctions
or RemoteEvents
.
So if I would do this inside a localscript now:
local part = Instance.new("Part", workspace) part.Name = "Brick" part.BrickColor = BrickColor.new("Yellow")
This part would only be visible for the player himself. I hope this gave you an idea to work with.