Why isn't the script working?

Put it at starterGui! (()()(()

1 Like

You can’t use buttons unless they are in the StarterGui. You might want to read this about making an interactive surface gui: In-Experience UI Containers | Roblox Creator Documentation

1 Like

The SheIs button worked now yay

1 Like

Just put your SurfaceGui in StarterGui and use its Adornee property. This property can be used to make interactive surfaces on Parts.

1 Like

Local scripts are not executed inside of the workspace (except if it is in a tool being used by the character)

See reference: LocalScript | Roblox Creator Documentation

So you have to relocate the localscript inside of a local-compatible location

1 Like

This should work

local SheIs = game.Workspace.Prova1.SurfaceGui.SheIs
local SheAre = game.Workspace.Prova1.SurfaceGui.SheAre
local ClickDetector = game.Workspace.Prova1.ClickDetector

ClickDetector.MouseClick:Connect(function(player)
    local clickedObject = player.Target
    
    if clickedObject.Name == "SheIs" then
        script.Parent.Transparency = 0.5
        script.Parent.CanCollide = false
    elseif clickedObject.Name == "SheAre" then
        SheAre.BackgroundColor3 = Color3.fromRGB(239, 78, 78)
    end
end)