okay hi!
I currently have this script:
local open = false -- a variable to define if its open or not script.Parent.MouseClick:Connect(function() model = workspace["Model"] -- A model in Workspace (aka Set Piece) if open then -- if open or if open == true open = false -- we set it to false so it doesn't do the same code model.Transparency = 1 model.CanCollide = false else -- you prob get this one lol model.Transparency = 0 model.CanCollide = true end end)
So like, I am wanting this button to be able to make A a different model go transparent and cancollide false. currently, not working
help!
What you can do it just change the:
model = workspace["Model"]
to that certain model, for e.g. say you model/rig is called Jack and he is in workspace then you would just do:
model = workspace.Jack
or if your model is inside of another model then, for e.g.
model = workspace.House.Jack
The house is the parent of Jack the model/rig
Hope this was kind of understanding and I hoped it helped.
for object: make a object. lets call this object A. put another object into object A. name this new object B. Object B is the button and object A is the object that is vanishing and re apeering. click workspace and turn on filtering enabled from the properties tab. add a click detector in side of the button or object B. put in a local script into StarterGui.
local script:
local A = --rename a to the name of the object you want to vanish and reapeer local clickdetector = game.Workspace.[A]ClickDetector clickdetector.MouseClick:Connect(function() game.Workspace.MyClickDetectorEvent:FireServer() end)
now add a Remoteevent to workspace. put a local script in this event. rename the remoteevent to MyClickDetectorEvent.
local script:
local A = workspace.part -- rename part to the object you want to reapeer game.Workspace.MyClickDetectorEvent.OnServerEvent:Connect(function() script.Parent.Parent.[A]Transparency = not script.Parent.Parent.[A]Transparency script.Parent.Parent.[A]CanCollide = not script.Parent.Parent.[A]CanCollide end)
I do not take credit for this. this was made from alvinblox.