Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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

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 minefeekyt 4 — 3y
0
Alright MyoldhamiYeari 0 — 3y
0
Nope, Doesnt work MyoldhamiYeari 0 — 3y
0
I fixed it MyoldhamiYeari 0 — 3y
View all comments (4 more)
0
:GetMouse is deprecated MarkedTomato 810 — 3y
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 MarkedTomato 810 — 3y
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. greatneil80 2647 — 3y
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. greatneil80 2647 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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.

Ad

Answer this question