I am working on a part placement mechanism in which I made a tool that places a clone of a part on the Baseplate. It worked, but I thought of adding a way to change the color of the part after it was placed down if the player has the Gamepass to be able to, but I do not know how to make the color picking system and having the script check if the player has the Gamepass.
Here is the model I created of this Part Placement mechanism if you need it: https://www.roblox.com/library/4764675897/CUSTOMIZABLE-Part-Placement-System
Is there a way to do this or will I just have to make a tool for each color I choose to have included with the Gamepass? If I have to make a tool for each color in the Gamepass, how would I implement that in this LocalScript (I also have the other Scripts/LocalScripts that are part of this system)?
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local localUtil = require(player.PlayerScripts:WaitForChild(“LocalUtil”))
local block = require(player.PlayerScripts.BlockUtil)
local graph = require(game.ReplicatedStorage.Scripts.GraphUtil)
local tool = script.Parent
local function onEquip()
localUtil.showSelectionPreview(“BlueBlock”)
end
local function onUnequip()
localUtil.hideSelectionPreview()
end
local function onClick()
local x, y, z = localUtil.getNormalizedMousePosition({game.Workspace.SelectionPreview})
local graphX, graphY, graphZ = graph.positionToGraph(x, y, z)
block.placeBlock(“BlueBlock”, graphX, graphY, graphZ)
end
tool.Equipped:connect(onEquip)
tool.Unequipped:connect(onUnequip)
tool.Deactivated:connect(onClick)