Hey there, trying to make a script that will remove everything from PlayerGui from Player on the event of touching a brick, but have ran into some issues. Could anybody help me out? not the best scripter so any advice would help tons!
local brick = script.Parent
local function steppedOn(part)
local parent = part.Parent
if game.Players:GetPlayerFromCharacter(parent) then
game.Players.LocalPlayer.PlayerGui:Destroy()
end
end
brick.Touched:connect(steppedOn)

1 comment
add : between getchildren and destroy