So what I am trying to do is kinda like in a tycoon door. So what I am wanting is where a person can claim a door when it is touched but if the name does not equal to the first name that has touched then it kills them. (Kinda like a tycoon door)
script.Parent.Touched:connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
local PlayersName = script.Parent:WaitForChild("PlayersName")
PlayersName.Value = hit.Parent.Name
if hit.Parent.Name ~= PlayersName.Value then
hum.Health = hum.Health - 100
end
end
end)

2 comments
Is there an error?
Nope