RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a script that makes a roblox game admin have more health when holding a certain tool"
-- local script inside the tool local tool = script.Parent local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local isAdmin = false local extraHealth = 200 -- Check if the player is an admin local adminList = {"Admin1", "Admin2", "Admin3"} -- Replace with actual admin usernames for _, admin in ipairs(adminList) do if player.Name == admin then isAdmin = true break end end local function onEquipped() if isAdmin then humanoid.MaxHealth = humanoid.MaxHealth + extraHealth humanoid.Health = humanoid.Health + extraHealth end end local function onUnequipped() if isAdmin then humanoid.MaxHealth = humanoid.MaxHealth - extraHealth end end tool.Equipped:Connect(onEquipped) tool.Unequipped:Connect(onUnequipped)