RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Write me a script that makes a player invulnerable to damage after touching a certain part"
-- server script local part = script.Parent local function makeInvulnerable(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player then local character = player.Character local humanoid = character:FindFirstChild("Humanoid") if humanoid then humanoid.MaxHealth = math.huge humanoid.Health = math.huge wait(10) -- Change this value to set the duration of invulnerability humanoid.MaxHealth = 100 humanoid.Health = 100 end end end part.Touched:Connect(makeInvulnerable)