What I Want To Achieve
I’m making a game that has the First 1000 ROBLOX Accounts. When a user hovers their mouse over the Character they want to see information about, a GUI is supposed to appear and tell them that information.
The Issue
The problem is that when I attempt to detect a change in the Target property of Mouse using Instance:GetPropertyChangedSignal, it does not fire whatsoever. Keep in mind that no errors occur in the script.
Solutions I’ve Tried
I’ve attempted to use Instance.Changed, however nothing fired when I tried that. On the Instance:GetPropertyChangedSignal page, it states ValueBase objects, such as IntValue and StringValue, use a modified Changed event that fires with the contents of the Value property. As such, this method provides a way to detect changes in other properties of those objects. This made no sense to me, as I tried doing what it said but was lost.
Script:
local Mouse = game.Players.LocalPlayer:GetMouse()
local Camera = workspace.CurrentCamera
local InfoFrame = game.Players.LocalPlayer.PlayerGui.InfoGui.InfoFrame
local function onChanged(Property)
local Target = Mouse.Target
if Property == "Target" then
if Target ~= nil then
if Target.Name == "StatueBase" then
InfoFrame.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
local Name = Target:FindFirstChildOfClass("StringValue")
local UserId = Target:FindFirstChildOfClass("NumberValue")
if Name.Value == "" then
InfoFrame.Info1.Text = "[ Doesn't Exist ]"
InfoFrame.Info2.Text = "nil"
else
InfoFrame.Info1.Text = Name.Value
InfoFrame.Info2.Text = UserId.Value
end
end
end
end
end
Mouse.Changed:Connect(onChanged)
The location of the LocalScript is game.StarterPlayer.StarterPlayerScripts.
Any help would be great. Thank you.