how come this script isnt working? there is a click detector in the button and im not sure what i need to add to make this work.
script.Parent.MouseButton1Down:Connect(function()
script.Parent.Parent.pole1.Transparency = 0
script.Parent.Parent.pole1.CanCollide = true
wait(2)
script.Parent.Parent.pole1.Transparency = 1
script.Parent.Parent.pole1.CanCollide = false
end)
end)
1 Like
Maybe you need the :connect event.
Example: (insert variable here).Touched:connect(Clicked)
Maybe something like that, I donât know I use it for my power up scripts
1 Like
kboy100
(kboy100)
#3
I think your issue is with using âMouseButton1Downâ which isnât an event of ClickDetector but is an event of Mouse.
Try this:
local clickDetector = script.Parent.ClickDetector
local function doStuff()
print("Foo")
end
clickDetector.MouseClick:Connect(doStuff)
that didnt work for some reason
You have 2 ends
Remove 1 end and youâll be good to go. Did you check your output?
Tidyen
(Tidyen)
#7
Please check your output to debug.
Thereâs 2 end)
's in the script, remove 1.
They already have their event connected. â:connectâ is deprecated while â:Connectâ isnât, their issue is that they have 2 ends
08Boat
(8Boat)
#9
Try this:
script.Parent.MouseClick:Connect(function()
--change pole transparency and cancollide here
end)
It should be inside of a ClickDetector.
alright thanks that should work
still didnt work any other suggestions for it to work
Is this script inside the ClickDetector or a Model?
its now inside the click detector
thanks for the help @08Boat i just made a new script listening to what you said and it now works
1 Like