local function hit()
game.StarterGui.DEATH.Enabled = true
wait(2)
game.StarterGui.DEATH.Frame.Transparency = 0.1
end
if game.Workspace.fencehit.Touched:Connect(hit) then
end
no errors in the code and nothing prints in the output when i touch the “fencehit” part, but the UI isn’t changing, please help.
There are many things wrong with this. You are trying to place a connection in an if statement, and changing the values of a object in StarterGui which wont affect anything until the player respawns.
Assuming a GUI named DEATH is already in StarterGui and replicated to the client and that this is a local script, this would probably do the thing you want:
script is located inside the part i want to make the ui appear
and i am trying to make it so the ui appears and then slowly fades after 2 seconds (i already did the fade part of the code just didnt put it in the one i posted)