Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do I make a brick only change color for one player?

Asked by 8 years ago

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?

0
Just use local scripts located in the player. User#11440 120 — 8y

1 answer

Log in to vote
3
Answered by
Kryddan 261 Moderation Voter
8 years ago

If you have FilteringEnabled on, then you could use localscriptsto make changes to everything inside of the workspace locally, which means only that player will see it. EnableFilteringEnabledby clicking on workspace and look into its properties and you would findFilteringEnabled. Keep in mind with it enabled all communication between client and servershould be made through RemoteFunctionsor 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.

http://wiki.roblox.com/index.php?title=Local_parts

0
I didn't realize filtering could do that. Thanks. GoldenPhysics 474 — 8y
Ad

Answer this question