I am not a good scripter but I do know enough to write “OK” scripts but today I was writing and came across an issue, I need a local script to call items in the workspace to be transparent
I have it where you can change the plant to another from a gui. I want it to be local so only the person clicking the change gui can see the difference
Try putting the script into StarterPlayerScripts, and then on the end where you connect, do this:
game.Workspace.Part.ClickDetector.MouseClick:Connect(onClicked) -- Also, use :Connect, :connect is deprecated.
-- ^ Change this to wherever your ClickDetector is.
you can also make your code more organized by doing something like this
local objects = {
workspace.PlantPot;
workspace.PlantPot2;
}
for _, object in ipairs(objects) do
for _, item in ipairs(object:GetChildren()) do -- assuming every child of PlantPot and PlantPot2 are base parts
item.Transparency = 1
end
end
you can also get workspace by using the builtin shorthand workspace so