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

How Can i change my cursor Color to red while cursor is on a something damagable?

damagables is a table that holds objects with damagable tags. i tried something like this but im getting addempting to call method 'FindFirstChild' (a nil value)

spawn(function()
	if player.Character:WaitForChild("Weapon") then
		if damagables:FindFirstChild(mouse.Target)then
			mouse.Icon = "http://www.roblox.com/asset/?id=3220002314"
		else
			mouse.Icon = "http://www.roblox.com/asset/?id=94643450"
		end
	end
end)

1 answer

Hi, what are tou adding at the damagable table? If you are adding the Name of the object then you can try something like this:

spawn(function()
    if player.Character:WaitForChild("Weapon") then
        if damagables[mouse.Target.Name] then
            mouse.Icon = "http://www.roblox.com/asset/?id=3220002314"
        else
            mouse.Icon = "http://www.roblox.com/asset/?id=94643450"
        end
    end
end)

I think this should work.

3 comments

0

I think :FindFirstChild() cannot be used for tables.

0

Yeah it worked thanks to you! i think i have problem with assets now so im gonna change them i think after that, everything will work properly. Thanks again

0

Np, I like helping people. :D

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