frrazers
(Frazer)
November 2, 2020, 6:52pm
1
this script won’t work
the answer to why is probably so obvious lol
btw i get no errors, and the scripts parent gets destroyed
local woodDisplayPart = game:GetService("Workspace"):WaitForChild("WoodDisplay1")
script.Parent.Click.MouseClick:Connect(function()
woodDisplayPart.Transparency = 0
woodDisplayPart.CanCollide = true
script.Parent:Destroy()
end)
LocalWE
(WilliApple)
November 2, 2020, 6:56pm
2
Add a ClickDetector into the part, and do this:
local woodDisplayPart = game:GetService("Workspace"):WaitForChild("WoodDisplay1")
script.Parent.ClickDetector.MouseClick:Connect(function()
woodDisplayPart.Transparency = 0
woodDisplayPart.CanCollide = true
script.Parent:Destroy()
end)
frrazers
(Frazer)
November 2, 2020, 6:56pm
3
There is a click detector, I just renamed it to “Click”
Add a wait before destroying (Characters)
frrazers
(Frazer)
November 2, 2020, 7:07pm
5
Still didn’t work. [charsssss]
What type of script is this? Local or server
frrazers
(Frazer)
November 2, 2020, 7:09pm
7
It’s a server script. (charss)
I don’t see any issues in your script probably try redifining the part
local woodDisplayPart = game.Workspace:WaitForChild("WoodDisplay1")
Also have a look at your part’s children check if there’s an actual click detector before clicking. Sometimes backdoors can ruin your game if found.
What is it you’re trying to do in the script that’s not working? Just in case, to make something invisible you need to do .Transparency = 1, while 0 is completely visible.
frrazers
(Frazer)
November 2, 2020, 7:14pm
10
I’m trying to make woodDisplayPart visible and CanCollide true when the click detector is clicked.
1 Like
script.Parent.Click.MouseClick:Connect(function()
local woodDisplayPart = game:GetService("Workspace"):WaitForChild("WoodDisplay1")
woodDisplayPart.Transparency = 0
woodDisplayPart.CanCollide = true
script.Parent:Destroy()
end)
Try this, and let me know how it goes. It could be that it needs to assign the variable when the MouseClick occurs, not just at the beginning of the script for whatever reason.
No that’s not the reason I just tried my own version and it totally worked, there’s no reason for yours to not work, probably check for weird behavior in your explorer as you might have backdoor going on.
2 Likes
Otherwise it could just be your own errors in setting the explorer environment
Ae_xxie
(Aexxy)
November 2, 2020, 7:28pm
14
Try this:
local DisplayPart = workspace:WaitForChild("WoodDisplay1")
local Click = Instance.new("ClickDetector")
Click.Name = "Click"
Click.Parent = DisplayPart
Click.MouseClick:Connect(function()
DisplayPart.Transparency = 0
DisplayPart.CanCollide = true
script.Parent:Destroy()
end)
Also make sure that the object is a BasePart (Wedges, Bricks, Spheres, Cylinders) and not a Model.
Ae_xxie
(Aexxy)
November 2, 2020, 7:33pm
15
Why would you need to set the transparency and collision before you destroy it?
frrazers
(Frazer)
November 2, 2020, 7:35pm
16
I’m not destroying the woodDisplayPart, i’m destroying the part you click to make it go visible.
Ae_xxie
(Aexxy)
November 2, 2020, 7:35pm
17
ok… then:
local DisplayPart = workspace:WaitForChild("WoodDisplay1")
local Click = Instance.new("ClickDetector")
Click.Name = "Click"
Click.Parent = DisplayPart
Click.MouseClick:Connect(function()
DisplayPart.Transparency = 0
DisplayPart.CanCollide = true
Click:Destroy()
end)