Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to change the color of the character's body parts, remove pants, destroy accessories, set animations, and set the humanoid health
- local function modifyCharacter(character, color, idleAnimationId, walkRunAnimationId, jumpAnimationId, fallAnimationId)
- -- Remove pants
- local pants = character:FindFirstChildOfClass("Pants")
- if pants then
- pants:Destroy()
- end
- -- Remove shirt
- local shirt = character:FindFirstChildOfClass("Shirt")
- if shirt then
- shirt:Destroy()
- end
- -- Destroy all accessories
- for _, accessory in pairs(character:GetChildren()) do
- if accessory:IsA("Accessory") then
- accessory:Destroy()
- end
- end
- -- Change the color of the body parts
- for _, part in pairs(character:GetChildren()) do
- if part:IsA("BasePart") then
- part.Color = color
- end
- end
- -- Remove face decal
- local head = character:FindFirstChild("Head")
- if head then
- local face = head:FindFirstChild("face")
- if face and face:IsA("Decal") then
- face:Destroy()
- end
- end
- -- Set the animations
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- -- Idle Animation
- local idleAnimation = Instance.new("Animation")
- idleAnimation.AnimationId = "rbxassetid://" .. idleAnimationId
- local idleAnimationTrack = humanoid:LoadAnimation(idleAnimation)
- idleAnimationTrack:Play()
- -- Walk/Run Animation
- local walkRunAnimation = Instance.new("Animation")
- walkRunAnimation.AnimationId = "rbxassetid://" .. walkRunAnimationId
- local walkRunAnimationTrack = humanoid:LoadAnimation(walkRunAnimation)
- humanoid.WalkSpeed = 16 -- Set a default walk speed if needed
- -- Jump Animation
- local jumpAnimation = Instance.new("Animation")
- jumpAnimation.AnimationId = "rbxassetid://" .. jumpAnimationId
- local jumpAnimationTrack = humanoid:LoadAnimation(jumpAnimation)
- -- Fall Animation
- local fallAnimation = Instance.new("Animation")
- fallAnimation.AnimationId = "rbxassetid://" .. fallAnimationId
- local fallAnimationTrack = humanoid:LoadAnimation(fallAnimation)
- -- Play animations based on state
- humanoid.StateChanged:Connect(function(oldState, newState)
- if newState == Enum.HumanoidStateType.Freefall then
- fallAnimationTrack:Play()
- walkRunAnimationTrack:Stop()
- idleAnimationTrack:Stop()
- elseif newState == Enum.HumanoidStateType.Jumping then
- jumpAnimationTrack:Play()
- walkRunAnimationTrack:Stop()
- idleAnimationTrack:Stop()
- elseif newState == Enum.HumanoidStateType.Landed then
- fallAnimationTrack:Stop()
- jumpAnimationTrack:Stop()
- idleAnimationTrack:Play()
- end
- end)
- humanoid.Running:Connect(function(speed)
- if speed > 0 and humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and humanoid:GetState() ~= Enum.HumanoidStateType.Jumping then
- walkRunAnimationTrack:Play()
- else
- walkRunAnimationTrack:Stop()
- end
- end)
- end
- -- Add a BillboardGui with TextLabel to the head
- if head then
- -- BillboardGui
- local billboardGui = Instance.new("BillboardGui")
- billboardGui.Name = "RedmanBillboardGui"
- billboardGui.Size = UDim2.new(0, 150, 0, 50) -- Adjust size for better visibility
- billboardGui.StudsOffset = Vector3.new(0, 1, 0) -- Adjust height offset to be closer to the head
- billboardGui.AlwaysOnTop = true
- billboardGui.MaxDistance = 20 -- Set MaxDistance to 20
- billboardGui.Parent = head
- -- TextLabel
- local textLabel = Instance.new("TextLabel")
- textLabel.Size = UDim2.new(1, 0, 1, 0)
- textLabel.Position = UDim2.new(0, 0, 0, 0)
- textLabel.BackgroundTransparency = 1
- textLabel.Text = "THE RED MAN"
- textLabel.TextColor3 = Color3.fromRGB(255, 0, 0) -- Bright red text color
- textLabel.TextStrokeTransparency = 0.5
- textLabel.Font = Enum.Font.Michroma -- Change to 'Michroma' font
- textLabel.TextSize = 30 -- Adjust text size
- textLabel.TextScaled = true
- textLabel.Parent = billboardGui
- end
- end
- -- Get the player and their character
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- -- Set the desired color, animation IDs, and health
- local redColor = Color3.fromRGB(255, 0, 0)
- local idleAnimationId = "18631254999"
- local walkRunAnimationId = "18631265977"
- local jumpAnimationId = "18604398787"
- local fallAnimationId = "18604405665"
- -- Modify the character
- modifyCharacter(character, redColor, idleAnimationId, walkRunAnimationId, jumpAnimationId, fallAnimationId)
- -- Listen for character respawn to apply the changes again
- player.CharacterAdded:Connect(function(newCharacter)
- modifyCharacter(newCharacter, redColor, idleAnimationId, walkRunAnimationId, jumpAnimationId, fallAnimationId)
- end)
Add Comment
Please, Sign In to add comment