I’ve tried and tried other ways but failed maybe is there any help from you guys???
Please help🙏
alright. i was planning to make a knife but when i try to play it and after that i am equipped and unequipped a bit when the knife throws itself when i am equipped and unequipped
Check this video

robloxapp-20220517-0036286.wmv (1.6 MB)
local mouse = game.Players.LocalPlayer:GetMouse()
local Tool = script.Parent
local contextActionService = game:GetService("ContextActionService")
function onButtonPress()
script.Parent:WaitForChild("RemoteK"):FireServer(mouse.Hit)
end
mouse.KeyDown:Connect(function(key)
key = key:lower()
if key == "e" then
script.Parent:WaitForChild("RemoteK"):FireServer(mouse.Hit)
end
end)
game.ReplicatedStorage:WaitForChild("RemoteK3").OnClientEvent:Connect(function(knife, character)
local knifeClone = knife:Clone()
knifeClone.Parent = workspace
knife:Destroy()
knifeClone.Touched:Connect(function(touched)
if touched.Transparency < 1 and not character:IsAncestorOf(touched) then
knifeClone.Anchored = true
wait(knifeClone.Hit.TimeLength)
knifeClone:Destroy()
end
end)
end)
Tool.Equipped:connect(function()
local mobilebutton = contextActionService:BindAction("MobileButton",onButtonPress,true,"e")
contextActionService:SetPosition("MobileButton",UDim2.new(0.72,-25,0.20,-25))
contextActionService:SetImage("MobileButton","http://www.roblox.com/asset/?id=1015507989")
end)
Tool.Unequipped:connect(function()
local mobilebutton = contextActionService:BindAction("MobileButton",onButtonPress,false,"e")
contextActionService:SetPosition("MobileButton",UDim2.new(0.72,-25,0.20,-25))
contextActionService:SetImage("MobileButton","http://www.roblox.com/asset/?id=3206285422")
end)