Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make someone's head color change blue while jumping?

Asked by 4 years ago
repeat wait() until game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)

local UIS = game:GetService("UserInputService")
local jumped = false
local player = game.Players.LocalPlayer
local char = game.Workspace[player.Name]

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)

I'm trying to make it so when a player jumps their head color temporarily turns to blue and then back to ogColor (their original body color before jump), it doesn't seem to be working, what have I done wrong or what do I need to do? Thanks.

0
have you checked for errors in your output? i'm thinking it could be an issue with the script loading faster than the player. Mayk728 855 — 4y

Answer this question