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

I have a script but it doesnt work, how can I get it to work with Filtering Enabled?

Asked by 6 years ago
Edited 6 years ago

CORRECTION: The script does work, but how can I get it to display the GUI right next to the mouse, and display their rank in a group as well?

01local Player=game.Players.LocalPlayer
02local gui = script.Parent.Frame
03 
04repeat wait() until Player and Player.Character and wait(5)
05 
06local Character=Player.Character
07local mouse=Player:GetMouse()
08local hoverPlayer = false
09 
10mouse.Move:connect(function()
11    if mouse.Target ~= nil then
12        local humanoid, player = mouse.Target.Parent:findFirstChild("Humanoid"), game.Players:FindFirstChild(mouse.Target.Parent.Name)
13        if humanoid and player then
14            if not hoverPlayer then
15                gui.NameLabel.TextColor3 = player.TeamColor.Color
View all 26 lines...
0
So your issue is solved? oreoollie 649 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Basically, when you turn Filtering Enabled on you are disconnecting the Client and Server side of your game. Your script here is on the Client side since you are using the Mouse object from the player. And now you want to hover over another player and get their name and health. To get the health of a player you are going to need their Humanoid, and where is that? That is on the server side. So in order to access it, you will need to Invoke the server using a Remote Function which will connect you to the server and return the value you need.

Here are two resources for you, devforum.roblox.com/t/what-is-filteringenabled/67927 wiki.roblox.com/index.php?title=Remote_Functions_%26_Events

0
The issue wasnt that it wont display health or anything, the issue was it wouldnt display the GUI at all, however I fixed that. ResoluteAyres 6 — 6y
Ad

Answer this question