{FIX} Transparency and Cursor

  1. What do you want to achieve?
    When we have a transparent “part” at 0.7 we don’t see the cursor and get no points, but when the transparency is 0
    The cursor appears and the points are registered

  2. What is the issue? Include screenshots / videos if possible!

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	local Part26 = game.Workspace.RotaModel1.Part26
	local ROtarandom = math.random(3,5)
	
	local PlayerPoind = player.leaderstats.Points
	
	local level = player.leaderstats.level
	
	if player then
		Part26.Transparency = 0.7
		wait(0.3)
		Part26.Transparency = 0
	end
	
	if Part26.Transparency(0) then
		player = false
		
	else
		player = true 
	end
	PlayerPoind.Value = PlayerPoind.Value + ROtarandom
end)

  1. What solutions have you tried so far?
    Tried Searching in Toolbox and DevForum but didn’t work

I would probably do something like this:

local part=script.Parent
local clickDetector=part.ClickDetector

clickDetector.MouseClick:Connect(function(player)
	
	if part.Transparency~=0 then return end -- just making sure the transparency is 0 before running the rest of your code
	
	-- your mouseclick code
	
end)

part:GetPropertyChangedSignal("Transparency"):Connect(function()

	if part.Transparency==0 then 
		clickDetector.MaxActivationDistance=32 
	else
		clickDetector.MaxActivationDistance=-1 -- this pretty much disables the click detector
	end
	
end)
1 Like

My mistake is that I did not specify the correct desks. Thank you, I will know for the future!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.