Hi, i’m making a system that when your mouse enter the button the selectionbox be visible, but when i equip some tool the selectionbox don’t be visible and the script doesn’t recognize it
I think the problem is with my tool and not with my script but idk what to do
Here are some images
Without the tool equipped: (Working)
With the tool equipped: (Not Working)
If someone know something will help a lot
Sorry for bad english
This is the code i tried:
local rs = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local runservice = game:GetService("RunService")
local remote = rs.Coisas.abrecoisa
local evento = rs.Coisas.plau
local function ligar(sele)
sele.Transparency = 0
end
local function desligar(sele)
sele.Transparency = 1
end
local plr = game.Players.LocalPlayer
local m = plr:GetMouse()
local function ishovering(part)
if part ~= nil and m.Target ~= nil then
if m.Target == part then
return true
else
return false
end
end
end
local col = game:GetService("CollectionService")
local ret = col:GetTagged("botao")
local port = col:GetTagged("porta")
for _, portas in pairs(port) do
if portas:FindFirstChild("SelectionBox") then
local sele = portas:FindFirstChild("SelectionBox")
runservice.RenderStepped:Connect(function()
if ishovering(portas) == true then
evento:Fire("aparece", "porta")
ligar(sele) --Makes selection Box Visible
elseif ishovering(portas) == false then
evento:Fire("fecha", "porta")
desligar(sele) --Makes selection Box Invisible
end
end)
end
end
Actually i’m not using “Mouse Enter” function but i got the same results