local Time = 1.5
local Damage = 100
debounce = true
script.Parent.Touched:connect(function(hit)
if (debounce == true) then
debounce = false
local a = game.Players:GetChildren()
for i = 1, #a do
if a[i].Name == hit.Parent.Name then
local b = hit.Parent:FindFirstChild("Humanoid")
if not b then return end
if b.MaxHealth >= 100 then
b.Health = 0
else
b.Health = b.Health - Damage
end
end
end
wait(Time)
debounce = true
end
end)
Although you know in my game Re-make there is a script that checks the commands, but it does not kill, I just do not miss it You are a programmer, you better know
Door = script.Parent
modelname="Red"
function onTouched(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if (human ~= nil ) then
if game.Players:playerFromCharacter(hit.Parent).TeamColor==game.Teams:findFirstChild(modelname).TeamColor then
-- Door.CanCollide = false
--Door.Transparency = 1
--wait(0.3)
--Door.CanCollide = true -- edit here
-- Door.Transparency = 1
else
human.Health = 0
end
end
end
connection = Door.Touched:connect(onTouched)
Shouldnât you ask your friend for help first then? Doesnât make much sense to ask about code that you yourself donât first understand, let alone code you didnât write. It makes explaining significantly more difficult and especially moreso when not enough information or applicability of presented concepts is happening.
Remember to check the Developer Hub if youâre interested in getting a start on Roblox programming.
In general, the script was designed to open doors
But now you can change it. Well, I can say that he checks the team of the player, can kill the player, if he does not belong to the team that was written in the script, the script works on my map, how to skip the spawn