How to make a Click F for a Flashlight in Roblox Studio Tutorial!

  Рет қаралды 230

JaydenGamez

JaydenGamez

Күн бұрын

so the flashlight script to make it equipt when you click f is _____________
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local function onInputBegan(input, gameProcessed)
if gameProcessed then
return
end
if input.KeyCode == Enum.KeyCode.F then
local Flashlight = ReplicatedStorage:FindFirstChild("Flashlight")
if Flashlight then
local player = game.Players.LocalPlayer
local backpack = player:WaitForChild("Backpack")
-- Check if the flashlight is not already in the player's backpack
if not backpack:FindFirstChild(Flashlight.Name) then
Flashlight:Clone().Parent = backpack
end
end
end
end
UserInputService.InputBegan:Connect(onInputBegan)
2nd script for camera -------------------------------------------------------------------------------
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local function onEquip()
-- Change the camera mode to LockFirstPerson
player.CameraMode = Enum.CameraMode.LockFirstPerson
-- Hide the character's humanoid arms
local character = player.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid:RemoveAccessories()
end
end
end
local function onUnequip()
-- Change the camera mode back to Default
player.CameraMode = Enum.CameraMode.Default
-- Show the character's humanoid arms
local character = player.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid:BuildRigFromAttachments()
end
end
end
script.Parent.Equipped:Connect(onEquip)
script.Parent.Unequipped:Connect(onUnequip)
if you want the flashlight script i didnt make you can have it it might do as spotlight or something script.Parent.Activated:Connect(function()
if script.Parent.Handle.SpotLight.Enabled == true then
script.Parent.Handle.SpotLight.Enabled = false
script.Parent.Handle.Sound:Play()
else
script.Parent.Handle.SpotLight.Enabled = true
script.Parent.Handle.Sound:Play()
end
end)
script.Parent.Equipped:Connect(function()
script.Parent.Handle.SpotLight.Enabled = false
script.Parent.Handle.equip:Play()
end)
script.Parent.Unequipped:Connect(function()
script.Parent.Handle.equip:Play()
end)
this is the asset id of the flashlight/torch ____11242492137

Пікірлер: 3
@ASarahMoo
@ASarahMoo 7 ай бұрын
Thank you bo it worked very good
@Egorka_pomeporka
@Egorka_pomeporka 4 ай бұрын
nice thx :D
@JaydenGameZz
@JaydenGameZz 4 ай бұрын
np
HOW TO MAKE A MAIN MENU 🛠️ Roblox Studio Tutorial
16:26
Itz_FloppyFish
Рет қаралды 555 М.
Unbelievable LUCK - LEGENDARY Spidertron - Factorio 2.0 Space Age
4:34
DataEngineerPlays
Рет қаралды 7 М.
When u fight over the armrest
00:41
Adam W
Рет қаралды 30 МЛН
Молодой боец приземлил легенду!
01:02
МИНУС БАЛЛ
Рет қаралды 1,7 МЛН
How To Make An E To Open Door In Roblox Studio (Easy & Quick)
9:06
How to STUDY so FAST it feels like CHEATING
8:03
The Angry Explainer
Рет қаралды 1,7 МЛН
How to Make a Smooth Realistic Flashlight in Roblox Studio
9:12
SomeRandumScripter
Рет қаралды 2,6 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 6 МЛН
How to make a clickable open/close door (Roblox Studio)
9:51
cole aftahi
Рет қаралды 6 М.
How To Make A Shirt In Roblox 2024 *Updated
15:57
casey CCW
Рет қаралды 305 М.
How To Make A Flashlight In Roblox Studio (QUICK & EASY)
8:05
How To Make A BATTLEGROUNDS GAME In Roblox Studio 2024
27:06
polarisprog
Рет қаралды 417 М.
Сборка бюджетного ПК от нейросети? 🤯
1:46
skibidi toilet 77 (full episode)
24:37
DaFuq!?Boom!
Рет қаралды 15 МЛН
😂АЛҒАШҚЫ ВИДЕОЛАРЫМЫЗҒА РЕАКЦИЯ
32:47
ЧОП КАЧОКҚА АЙНАЛДЫ (GTA V)
56:02
MANGO PLAY
Рет қаралды 60 М.
ОЧЕНЬ ГОДНЫЙ ХОРРОР ► Dreamless #1
48:06
Kuplinov ► Play
Рет қаралды 330 М.