Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Mouse.Target Find first child error how to fix it?

Hi my code didnt work and ended up with an Attempt to index nil with findfirstchild is there any way to fix it?

heres the code in pastebin

https://pastebin.com/wDjwECuK

8 comments

0

i think it because u put ('HoverInfo') at the bottom of ur script try to put the same thing in the Find first child

0

Alright

0

Nope, Doesnt work

0

I fixed it

0

:GetMouse is deprecated

0

local mouse = game.Players.LocalPlayer:GetMouse() mouse.Move:Connect(function() local target = game.Players.LocalPlayer:GetMouse().Target couldn't you just do local target = mouse.Target

0

yes he could but he didn't and that doesn't help solve the answer to his question. Also this looks like deobfuscated synapse code lmao. Use an if statement to bypass the error.

0

Also tomato, https://developer.roblox.com/en-us/api-reference/function/Player/GetMouse would have listed it as deprecated. It's listed as unsafe. That is not the same as deprecated.

1 answer

Fixed, I changed the code a bit from those stuff

local v62 = target.HoverInfo:WaitForChild("HoverName")
local v65 = target.HoverInfo:WaitForChild("HoverDesc")

and did this to it :

local v62 = target:FindFirstChild("HoverInfo"):WaitForChild("HoverName")
local v65 = target:FindFirstChild("HoverInfo"):WaitForChild("HoverDesc")

and changed

elseif not target:FindFirstChild('HoverInfo') then

to

elseif target ~= nil and not target:FindFirstChild('HoverInfo') then

there is still some code that i need to fix, but its just the visible, tween code which is no problem for me.

This discussion is preserved as it was. New answers, comments, and votes are closed.