#MouseEnter() not firing [Frame]
1 messages · Page 1 of 1 (latest)
Because of your for cycle, it will not stop for your function to do something, it will fire the function, then go to the next frame, and will kill the function your previous function
have you tried getting input with textbutton instead of the frame itself
im pretty sure a connection is only getting disconnected by either
the instance or its ancestor getting :Destroy(ed)
or
you disconnect it yourself
local slots = {frame1, frame2, frame3} -- your inventory slot
local Mouse = plr:GetMouse()
local plrGui = plr:WaitForChild("PlayerGui")
local function getFrame(frame)
local guiObject = plrGui:GetGuiObjectsAtPosition(Mouse.X, Mouse.Y)
for _, currentFrame in ipairs(guiObject)
if currentFrame == frame then
return currentFrame
end
return nil
end
while task.wait() do
local activeFrame = nil
for _, element in ipairs(slots)
activeFrame = getFrame(element)
end
if activeFrame ~= nil then
--here change your color or some shit
end
end
Try this
Maybe, but in his case still not working
i dont think it has anything to do with the MouseEnter signal? maybe the way roblox treats input from other ui elements that have Active disabled by default
just like how they put "DisableFallFromHeight" or something property in workspace that doesnt work
Not familiar with it
Maybe because of how "for cycle" works, the cycle begins it creating function in memory, cycle iteration ends - function gets deleted from memory
basically theres these 2 properties in the workspace called "FallenPartsDestroyHeight" and "FallHeightEnabled", FallenPartsDestroyHeight is an integer and FallHeightEnabled is a boolean. you would think FallHeightEnabled would disable FallenPartsDestroyHeight right? but nope, it does nothing
thats not how connections work, they dont just "get deleted once its done", you need to use :Once() if you want that to be the case
in this case he used :Connect()
Maybe because it only checks if mouse is on gui in this cycle?
no
hes basically creating a "Connection" and attach it to the frame basically checking if Mouse is Enter using the built in MouseEnter signal
i dont think for loops change the behavior of connection in general
Or maybe it does?
** You are now Level 4! **
try it yourself
Cannot currently - I am on my phone in school
maybe for example
local baseplate = workspace.Baseplate
baseplate.Touched:Connect(function()
print("hello")
end)
end```
Is it working?
i shouldve use Once for this example
but doesnt matter
that will print 5 times since you created 5 connections
Maybe because of table behavior, since he using inventory slot and it is table
im pretty sure inventorySlots is a table
he loops through it
and make a MouseEnter connection
on each frame
im not sure if the problem is with Activate or Interactable, but it sure isnt the script
Yes, I said that he is using table, and table may have different behavior
the script is working fine
like i said
it may be how roblox treats input on ui elements that have Activate disabled by default
I was referring to OP script
Maybe
ik youre refering to his script, i also was 😭
No his script was not printing message when he was hovering over frames
yes
thats what im saying 😭
it works fine but the problem is with roblox MouseEnter signal
it may not fire for frames even with active enabled
Now I understood
That is definitely MouseEnter problems