So, so if you read the title i cant understand why KeyDown isnt working with Mouse.Target so. I want it to be so if you have the mouse on the item on the Part and then press F then that part/model will remove from the workspace but i wont get the KeyDown to work with Mouse.Target why?
Script:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local camera = workspace.CurrentCamera
local Keys = {}
while true do
wait(0.1)
if mouse.Target ~= nil then
if mouse.Target.Parent.Name == "Items" then
if Keys[Enum.KeyCode.R] then
print('hi')
end
else
script.Parent.Visible = false
print('nil')
end
end
end

5 comments
Thanks, it worked but if i want a model instead of a part what do i do then?
if targ.Parent.Name == "name" then on line 11, or something.
If i do that then the thing inside the model just destroys and have to press R multiple times on all the parts?
Also destroy the model, not the part on line 12. targ.Parent:Destroy()
Thanks ;)