this code is inside a gui, and it worked perfectly, but now it just dosent for some reason without change. it says the the part name is a nil value despite it being in workspace, and I know I named it right, I literally copy and pasted the name straight from the part to put into this script. heres the script: (just to clarify, this is only happening with the 3rd line, aka the part.touched thing.)
local part = game.workspace:FindFirstChild("Beggining")
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Parent.Enabled= true
wait(5)
script.Parent.Parent.Enabled = false
end
end)
local part = workspace:FindFirstChild("Why")
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
wait(1)
script.Parent.Parent.Enabled= true
wait(5)
script.Parent.Parent.Enabled = false
end
end)
local part = workspace:FindFirstChild("YES")
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
wait(1)
script.Parent.Text.Text = "TEST"
script.Parent.Text2.Text = "TEXT"
script.Parent.Parent.Enabled= true
wait(5)
script.Parent.Parent.Enabled = false
end
end)

1 comment
INFO: i changed the 1st line to local part = workspace:FindFirstChild("Beggining") so i bassically removed the game.worspace from the 1st line, still dosent work.