How to disable unequipting a flashlight

Use a weld constraint. I think your problem is solved now, right?

weld constrant? whats that? do i just put a weld inside it and it welds to me automattically

You can also put a Motor6D if you want to animate the flashlight. You look in the properties of the Motor6D and select Part0 as Torso or something and Part1 as the flashlight.

i put a weld contstrant inside of flashlight and its position is updating with mine but its still not emitting light

Put a surface light inside of the flashlight.

i made a new part named Flashlight and put a point light inside of it but now its not updating the position anymore

i actually see the flashlight but its not inside of me its just sitting here on the ground

image

no the issues not solved @robloxguy9093ALT

local character = script.Parent
local flashlight = game.ReplicatedStorage.Flashlight:Clone()
flashlight.Parent = character
local surfacelight = Instance.new("SurfaceLight")
surfacelight.Parent = flashlight
local weld = Instance.new("Motor6D")
weld.Part0 = flashlight
weld.Part1 = character:WaitForChild("Torso")
weld.Parent = flashlight
surfacelight.Angle = 90
surfacelight.Brightness = 7.83
surfacelight.Range = 60
flashlight.CanCollide = false

ok so the point light follows me but im not seeing the flashlight model being in front of me

Just make an Idle Animation for the flashlight being in front of you.

i dont think you can add models to animations

anyways this issue is bassically solved! thanks.

Mark it as solved then.

Also what’s stopping you from getting a Motor6D, attaching it to the Right Arm (just like tools) and not have to use tools at all? You can animate other parts that aren’t usually found in a Character model with Motor6Ds. This will prevent the use of the flashlight as a tool and what not. You can follow this guide for reference.

Just disregard the whole tool setup.

the issue actually isnt solved becuase the part is like 5 studs away from player and was messing up movement by colliding with parts in that 5 stud radius even though the player didnt hit that part but since its grouped inside player it counted as player collision stopping movment etc

so 2 issues remain

-making it non collidable
-making it inside the player instead of 5 studs away

by the way im prety sure the article you provided stuff gives the player the option to equipt and unequipt the flashlight and also the backpack menu.

Put flashlight.CanCollide = false in the script.
Put flashlight.CFrame = player.Character.HumanoidRootPart.CFrame

You sort of missed the entire point I just said;

If you use a Motor6D, the Flashlight should teleport to the position of the arm. If it doesn’t, you’re doing something incredibly wrong with your flashlight’s setup.

If you do successfully get it stuck inside your arm, all you have to do is animate it to look like a normal toolgrip. I did this very exact process with a Hip Radio that plays music. Doesn’t collide with players either because the parts used have CanCollide turned off. Not to mention it’s also located exactly where I animated it, on the hip of the character.

image
Before you go and say that you’re using R6, and I’m using R15 and that it won’t work, it will, you just have to animate it for the R6 rig instead of the R15 rig. It’s done the exact same way.

I don’t know if somebody has answered your question or you have found a solution, but if you want to prevent somebody from unequipping a flashlight then try:

  • Disabling the backpack GUI and equipping any tools into the players character when they spawn,
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
--put this in a localscript in starter player scripts
game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local tool = game:GetService("StarterPack"):FindFirstChild("Flashlight"):Clone() --Flashlight is your tool name, replace that
		tool.Parent = char		
	end)
end)
--put this in a normal script in server script storage, this gives each player a flashlight when they spawn
  • Or forcing them to hold the tool by equipping it whenever they unequip it,
game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local tool = game:GetService("StarterPack"):FindFirstChild("Flashlight"):Clone() --Flashlight is your tool name, replace that
		tool.Parent = char		
	end)
end)
--put this in a normal script in server script storage, this gives each player a flashlight when they spawn
local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local char = player.Character
if not char or not char.Parent then
	char = player.CharacterAdded:Wait()
end

tool.AncestryChanged:Connect(function(child, parent)
	if not parent then return end --the tool was destroyed
	if parent ~= char then
		script:FindFirstChild("RemoteEvent"):FireServer(char, child) --parent a remote event to this script, and a normal script to the remote event
	end
end)

--the script is a child of the tool, the tool should be in the players character, this fires an event to the server when the tool is unequipped
local event = script.Parent

event.OnServerEvent:Connect(function(player, char, tool)
	char:FindFirstChildWhichIsA("Humanoid"):EquipTool(tool)
end)
--put this inside a remote event, and the remote event inside the local script, this will re equip the tool when the player un equips it

Sorry if this post is bad, its my first one
nevermind, it was solved
ill just leave this here