With this script, I am making it so every time the player presses the Key "F" it fires, and makes a clone of the face and puts an image on it, and the original face is transparent, but nothing happens. There is also no error in the output. Here is the script:
local Player = game.Players.LocalPlayer
Character = Player.Character
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
local UserInputService = game:GetService("UserInputService")
local NewFa = game.Players.LocalPlayer.NewFa
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.F then
if NewFa.Value == false then
NewFa.Value = true
Character.Head.face.Transparency = 1
local facez = Character.Head.face:Clone()
facez.Transparency = 0
facez.Name = "facez"
facez.Image = ("rbxassetid://918741416")
else
NewFa.Value = false
Character.Head.face.Transparency = 0
Character.Head.facez:Destroy()
end
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
