F for Flashlight with Model

So I really love horror games and I play them alot, and recently I wanted to make my own horror game everything went fine until the flashlight came I wanted the game to be as realistic as possible and so I recently saw a game that has F for Flashlight with a Model and Animations and I couldnt figure out how. I tried to add when you press F a Model to your right arm and stuff like that but nothing worked. Can somebody please explain how I could do that? Thank you!

You would use InputService to detect if the player pressed F

1 Like

Now I don’t know to much pass this like animations and stuff like that but heres a script!

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input, gameProcessed)
	if input.UserInputType == Enum.UserInputType.Keyboard then
		if input.KeyCode == Enum.KeyCode.F then
			print("You've pressed F") -- Your code here if the player does press F
		end
	end
end)
3 Likes

Use Input Service to detect when the player presses F. When he does so, clone a flashlight tool from replicated storage directly inside a character, so that tool gets equipped immediately. When he presses F again, destroy that tool

1 Like

Adding on to @simply_kiel 's post you could have a motor6D parented to either arm of the player’s character upon joining and when the player presses f you could fire a remote to attach your flashlight model to said motor6D and play your animation

2 Likes

that sounds good Ima try it later

Sure mate, mark it as solution if it helps

1 Like

wow thank you guys for you good ideas I never thought that my post would get any comment lol

yea Ima try it now and see if it works

So it turned out you can just use a viewmodel with a flashlight!