repeat wait() until game.Players.LocalPlayer.Character local UIS = game:GetService("UserInputService") local jumped = false local player = game.Players.LocalPlayer local char = player.Character UIS.InputBegan:connect(function(input) if input.Keycode == Enum.KeyCode.Space and not jumped then jumped = true local ogColor = char:FindFirstChild("Head").BrickColor char:FindFirstChild("Head").BrickColor = BrickColor.new("Bright blue") wait(0.5) char:FindFirstChild("Head").BrickColor = BrickColor.new(ogColor) jumped = false end end)
As well as not being sure if this script works, I also get a "attempt to index nil with 'Character'" error in console.
I also would rather have the color change back to the original Player's head color after the jumping animation ends (rather than 0.5 seconds) but am not sure how to implement that.
Hello, In your script you wrote "char = player.Character" which is not a thing, at least not anymore. The player which is in game.Players is basically the client. If you want to get the actual head it would be in the workspace, the player's physical character, which is the head, torso, shirt, hat, etc.
repeat wait() until game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name) -- this would work local UIS = game:GetService("UserInputService") local jumped = false local player = game.Players.LocalPlayer local char = game.Workspace[player.Name] -- This would work as it finds the model inside workspace by getting the players name UIS.InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.Space and not jumped then -- KeyCode must be capital jumped = true local ogColor = char:FindFirstChild("Head").BrickColor char:FindFirstChild("Head").BrickColor = BrickColor.new("Bright blue") wait(0.5) char:FindFirstChild("Head").BrickColor = BrickColor.new(ogColor) jumped = false end end)