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!
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)
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
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
that sounds good Ima try it later
Sure mate, mark it as solution if it helps
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!