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

How do I add a morph with a keyboard input?

Asked by 6 years ago
Edited 6 years ago

I want to add a morph with a keyboard input, so what it is supposed to do is to make it that when a player clicks f, he morphs into a giant monster. It is not working for me please help. This is what I already tried:

Morph = game.ServerStorage.StarterCharacter
function onKeyPress(actionName, userInputState, inputObject)
    if userInputState == Enum.UserInputState.Begin then
        StarterCharacter = Instance.new("Morph",game.StarterPlayer)
        game.StarterPlayer.StarterPlayerScripts.TitanShift.TitanMusic.TimePosition = 0
        game.StarterPlayer.StarterPlayerScripts.TitanShift.TitanMusic.Playing = true
        wait(7)
        game.StarterPlayer.StarterPlayerScripts.TitanShift.TitanMusic.Playing = false


    end
end


game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.F)

I already have the monster I want the players to morph into in serverstorage. I named it StarterCharacter, but cant make it go into StarterPlayer when I click F. Also the music works fine :D

0
Try welding morths HumanoidRootPart to players and deletuing players parts/accesories except HumanoidRootPart Shadowman670 -4 — 6y

Answer this question