local distance = 4
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E then
local chr = game.Players.LocalPlayer.Character
local mouse = game.Players.LocalPlayer:GetMouse()
local torso = chr:FindFirstChild("Torso")
if (torso-mouse.Target).magnitude < distance then
mouse.Target.RemoteEvent:FireServer()
end
end
end)
I get an error called attempt to perform arritmetic(sub) on nil and Instance. Local in startergui. Please help. Also I'm trying to make a script that sends a signal to the scripts inside the parts that the mouse is hovering over, resulting in interaction with objects. Hope you understand.

1 comment
Oh so that s why.Thank you very much.