Ok so i have a local script that should show a billboard gui to a player who is hovering over an object:
while wait(.1) do if (player.Character.UpperTorso.Position - car1D.Position).magnitude < range then if mouse.Target then if mouse.Target.Name == "car1Check" then print(player.Name.." is in range with car1") replicatedStorage:WaitForChild("carGui"):Clone().Parent = car1D else if car1D:FindFirstChild("carGui") then car1D:FindFirstChild("carGui"):Remove() end end end else if car1D:FindFirstChild("carGui") then car1D:FindFirstChild("carGui"):Remove() end end end
This script also removes the gui when the object is not hovered.
However this only works for the first player who hovered, they can see the gui and noone else can which is good, cause FE is enabled.
But when another player, lets call it player2 hoveres over that object, that same player2 can't see the billboard gui for some reason (and ofc noone else can cause of FE).
So basically with FE i want it to only show to that one player who is hovering but it only works for the first player who hovered.
Any help on how to fix it?
.Touched
function. You can add a part and if the player is standing on it, then make it visible.So here is the link to remote events: http://wiki.roblox.com/index.php?title=Remote_Events_and_Functions
Remote Events require 2 scripts, a Local script and a Server Script.
Now, I'm not going to help you create the script but I will help on how.
First, you need to add a RemoteEvent into ReplicatedStorage
. Now you have to figure out a way to activate the script in the LocalScript
you can try .Touched or something like that.
Next, let's get into the script;
Local Script:
local RE = game:GetService('ReplicatedStorage'):WaitForChild('RemoteEvent') -- Other variables game.Workspace:FindFirstChild('Part').Touched:Connect(function() -- you have to figure out how you want to activate the code. RE:FireServer() -- this fires a signal to a ServerScript end)
Server Script:
local RE = game:GetService('ReplicatedStorage'):WaitForChild('RemoteEvent') RE.OnServerEvent:Connect(function() -- with this line, you receive the signal -- Do stuff, show GUI etc end)
For the local script, your basically activating the code and server script is actually doing it. Read the Remote Events for more information, RemoteEvents can also send variables, but that is for other stuff. Anyway, I hope this helped you in some sort of way. If so please Upvote and accept answer
-- Your orange, BlackOrange3343 PS: Good luck on your game