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

How do I use Mouse Target?

mouse = game.Players.LocalPlayer:GetMouse()

while wait() do
Target = mouse.Target
if Target.Lootable.Value == true then
print "Lootable"
elseif Target.Lootable == nil then end
end

Output: "Lootable is not a valid member" Lootable is a BoolValue

How do I get it to work?

2 answers

Um. You cannot directly go to a value in the target here

mouse = game.Players.LocalPlayer:GetMouse()

while wait() do
Target = mouse.Target
if Target:FindFirstChild("Lootable") then
if Target.Lootable.Value == true then
print("Lootable")
elseif not Target:FindFirstChild("Lootable") then 
print("Ended")
end
end
end

1 comment

0

It said Lootable not valid member due to it didn't find it on first target so the script got disconnected (A.K.A Kinda like disabled) So you have to make sure it is found before you continue rest of script.

Thanks, I appreciate the help but it says that is still nil at line 6

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