I am making a part so when I touch it, it makes a LocalScript in the PlayerGui NOT disabled. But I always come up with the "attempt to index nil with 'PlayerGui' " error. Any help fixing this problem?
Error:
https://imgur.com/z4P8EaZ
Code:
local debounce = false
function onTouched(hit)
if debounce == false then
debounce = true
game.Players.LocalPlayer.PlayerGui.Dialog4.Disabled = false
debounce = false
end
end
script.Parent.Touched:connect(onTouched)
-- Script is placed inside a Part, inside the Workspace.

1 comment
Couldn't you do whatever Dialog4 does in this script?