Interaction method, when you mouse over something, a function is fired. Having trouble with the mouse being nil.
Problem: Players.Player1.PlayerGui.LocalPlayerScripts.Interaction:276: attempt to index field 'Target' (a nil value)
Problematic code section:
--mouse and functions already defined in another part of the script.
--MouseOver Interact item
local Interact = pcall(mouse.Target.Changed:connect(function()
if mouse.Target then
if mouse.Target.Name == "Prop" then
HelpBarOpen("Press 'E' to morph into this prop.")
else
HelpBarClose()
end
if mouse.Target.Parent:FindFirstChild("Active") then
HelpBarOpen("Press 'E' to interact with this" ..mouse.Target.Parent.Name".")
elseif mouse.Target.Parent.Parent:FindFirstChild("Active") then
HelpBarOpen("Press 'E' to interact with this" ..mouse.Target.Parent.Parent.Name".")
else
HelpBarClose()
end
end
end))

1 comment
I felt that after reading that Target was a property, I would give changed a shot.