.Activated dosn't fire

This:

MinB.Activated:Connect(function(inputObject: InputObject, clickCount: number)
    print(inputObject.Name)
end)

Does nothing when I press the Button I had the same problem some time ago too, but I don’t know the solution anymore. Do you know how I can fix that?

1 Like

Is it a Tool or a ClickDetector?

wait, is this a gui button you are connecting the event to? that makes sense, the event is connected the right way, but could you show us the full script?

1 Like

Assuming this is a GUI button, it’s possible that the property MinB.Active is false, try setting it to true. If that doesn’t work, you might need to increase the property MinB.ZIndex to a higher value.

Yes. Its a Surface GUI Button.

local GUI = script.Parent.SurfaceGui.Frame
local FaceGui = GUI.Face
local Cam = script.Parent.Parent.Cam
local ProxPrompt = Cam.ImageProx
local Sound = ProxPrompt.TakePictureSound
local MinB = GUI.Min
local MedB = GUI.Med
local MaxB = GUI.Max
local function ResetBoard()
	GUI.OfficerName.Text = "Roblox"
	GUI.Datum.Text =  tostring(os.date("%d/%m/%Y %H:%M:%S"))
	local Text = ("Name: [unknown] \n Age: [unknown] \n Crime: [unknown] \n Info: [unknown]")
	GUI.Info.Text = Text
	local succes, data = pcall(function() 
		return game.Players:GetUserThumbnailAsync(1,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size180x180)
	end)

	if succes then
		FaceGui.Image = data
	else
		warn("Could not get the UserThumbnail: "..data)
	end
end
ProxPrompt.Triggered:Connect(function(TriggerPlayer)
	--Check if the player is a officer with a high enough rank
	
	local player = game.Players:WaitForChild("Misterx114",10)
	local succes, data = pcall(function() 
		return game.Players:GetUserThumbnailAsync(player.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size180x180)
	end)

	if succes then
		FaceGui.Image = data
	else
		warn("Could not get the UserThumbnail: "..data)
	end
	Sound:Play()
	local age = tostring(math.random(18,60))
	local crime = "nothing"
	local info = "Aggressive"
	local Text = ("Name: "..player.DisplayName.." \n Age: "..age.." \n Crime: "..crime.." \n Info: "..info)
	GUI.Info.Text = Text
	GUI.OfficerName.Text = TriggerPlayer.DisplayName
	local date =  tostring(os.date("%d/%m/%Y %H:%M:%S"))
	GUI.Datum.Text = date
	task.wait(60*3)
	if GUI.Datum.Text == date then
		ResetBoard()
	end
end)
MinB.Activated:Connect(function(inputObject: InputObject, clickCount: number)
	print(inputObject.Name)
end)

--Check distance
ResetBoard()

With MouseButton1Down it works. But I need .Activated

i think .Activated only works with tools

its a button GUI activated event, its on the docs, it returns input object and click count

pretend i never said anything then :sunglasses:

Pretty sure you have to use .MouseButton1Click

Yes, that’s what I’m talking about. What I said should fix your issues. Did you try that?

what type of script is it? I dont know if anyone asked but im gonna

ServerScript. Its a SurfaceGUI.
:no_mouth:

They are all with a high Z index, and active. Also it works with .MouseButton1Down

.activated only works on the client. From my knowledge at least. This needs to be on a local script

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