local namePart = workspace.NamePart
local nameText = namePart.SurfaceGui.TextLabel
script.Parent.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
local p = game.Players:GetPlayerFromCharacter(hit.Parent)
local PlayerName = p.Name
if hum and p then
if p.UserId == game.CreatorId then
script.Parent.CanCollide = false
script.Parent.Transparency = .25
wait(3)
script.Parent.CanCollide = true
script.Parent.Transparency = 0.5
else
hit.Parent:BreakJoints()
end
if hum and p and namePart and nameText then
nameText.Text = p.Name
end
end
end)
script.Parent.Touched:Connect(function(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
local p = game.Players:GetPlayerFromCharacter(hit.Parent)
local PlayerName = p.Name
if nameText and h and p then
if nameText.Text ~= PlayerName then
print("the name is different")
h.Health = 0
end
end
end)
this is a server script parented to a part in the workspace everything works fine but i want that only the player that touched it first to be able to walk through it any help is apriciated

4 comments
Does it give you any errors? I looked at it, and it seems fine. I also highly doubt you wrote it yourself.
this is why you use a debounce
can i get an example of that please?
and i actually got some help from a yt video and the rest is my own work