Need help on Keycodes Enabling fire

I Need help on Keycodes Enabling fire

  1. I need help scripting a local script that enables fire inside a Starter Character when pressed.

  2. Every time I try it using This Script Below it doesn’t work, I’ve been looking online and nobody seems to have a solution, I have a Starter Character with the part inside it and the script Recognises it and the fire effect inside it.

I just need a solution that enables the Fire on the Key Pressed, I know the basics of doing it, For example I have this “local Key = F” and “if Input.KeyCode == Enum.KeyCode[Key] then”

Any help would be appreciated
Thanks

2 Likes

Maybe because you have both of them as true?
image

Also you shouldn’t send your code in an image, send it in format instead
```lua
Test = true
```

1 Like

Try this

local UserInputService = game:GetService("UserInputService")
local char = game.Players.LocalPlayer.Character
local fire = char.Firepart.Fire
UserInputService.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.Keyboard then
        if input.KeyCode == Enum.KeyCode.E then
            fire.Enabled = true
else
fire.Enabled = false
        end
    end
end)
3 Likes