How do I add a morph with a keyboard input?
Asked by
7 years ago Edited 7 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:
01 | Morph = game.ServerStorage.StarterCharacter |
02 | function onKeyPress(actionName, userInputState, inputObject) |
03 | if userInputState = = Enum.UserInputState.Begin then |
04 | StarterCharacter = Instance.new( "Morph" ,game.StarterPlayer) |
05 | game.StarterPlayer.StarterPlayerScripts.TitanShift.TitanMusic.TimePosition = 0 |
06 | game.StarterPlayer.StarterPlayerScripts.TitanShift.TitanMusic.Playing = true |
08 | game.StarterPlayer.StarterPlayerScripts.TitanShift.TitanMusic.Playing = false |
15 | 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