So I tried to make the map visible to one player but apparently, all of the players can see it. I did put the local script in the StarterGui and the Filtering Enabled is on.
workspace.Entrance.Part01.Touched:Connect(function() if not workspace.CurrentCamera:FindFirstChild("RoadMap") then game.ReplicatedStorage.RoadMap:Clone().Parent = workspace.CurrentCamera end end)
Hey buddy!
I've always hated these types of issues and they're very annoying to fix, but let me help ya!
First, I need to teach you about RemoteEvents
.
RemoteEvents are the bypasser of this type of issue, as they're able to pass information from the entire server to only one player.
In this case, it would help you!
Secondly, insert a RemoteEvent
into the ReplicatedStorage
and name it however you like.
Put a regular script inside and type in:
script.Parent.Touched:Connect(function(hit) if hit.Parent:WaitForChild("Humanoid",10) then -- checking if the touching guy is a player local player = game.Players:GetPlayerFromCharacter(hit.Parent) -- getting the player by using the character game.ReplicatedStorage.RemoteEventNameHere:FireClient(player) --The thing inside the brackets are telling the remoteEvent who to fire it to, so in this case, the player! end end)
Lastly, insert a LocalScript
into the StarterGui
and then type in:
game.ReplicatedStorage.RemoteEventNameHere.OnClientEvent:Connect(function() --listening for the remote event -- code here end)
To learn more about RemoteEvents
, go to here