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

What is the best way to make parts visible to certain players?

Asked by
tjtorin 172
5 years ago

I have a bunch of buttons in a tycoon that I am making and so far they are visible to everyone but I want them to be visible to only the owner of the tycoon. I tried using remote events to make the buttons visible in a local script but that did not work. What do you think is the best way to solve this problem?

-- Local script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remotes = ReplicatedStorage:WaitForChild("Remotes")
local setTrans = remotes:FindFirstChild("SetTrans")

setTrans.OnClientEvent:Connect(function(object, t)
    object.Transparency = t
end)
0
If your game is FE, then just make it local to the player. User#29320 0 — 5y
0
Are you firing the RemoteEvent? Are you providing the right parameters? Unhumanly 152 — 5y
0
In the server script, make sure you're firing the RemoteEvent properly. For example, RemoteEvent:FireClient(game.Players.PlayerName, game.Workspace.Part, 0.5) Unhumanly 152 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

Assuming the buttons are meant for stepping on them to buy things, you should make them all on the server and set their transparency to 1 so they're invisible on the server. When set person claims the tycoon it should make all buttons on that tycoon visible for the LocalPlayer (on the client)

This way you can still handle the Touched on the server but without clients seeing them apart from the tycoon owner.

Ad

Answer this question