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

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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.

0
I think :FindFirstChild() cannot be used for tables. Scefrom 0 — 4y
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 emay0660 13 — 4y
0
Np, I like helping people. :D Scefrom 0 — 4y
Ad

Answer this question