How do I make bricks only appear to a specific client?

Alright so I have a LocalScript (in ServerScriptService) that’s supported to make a set of parts with text on them appear to a specific person, but the script just does not work. There are no errors that are thrown so I don’t really know why. The script runs when a RemoteEvent receives a Client triggered by an Admin Command. If you need me to elaborate more, just ask

Script:

function Run(arg)
	if arg == "off"  then
	for i, v in pairs(workspace:GetChildren()) do if v.Name == "TableNum" then
	v.Transparency = 1	
	v.SG.Enabled = false
	end end
	elseif arg == "on" then
			for i, v in pairs(workspace:GetChildren()) do if v.Name == "TableNum" then
	v.Transparency = 0
	v.SG.Enabled = true
	end end
	end
end

game.ReplicatedStorage.Restaurant.TableCount.OnClientEvent:Connect(Run)

Your post is missing some information: Are there any errors in the output? Where did you parent the LocalScript? Does the command from the server script actually run? Show the code from the server script with the execution of the command. You can try using print functions in both scripts to see if they’re running fine

  1. There are no errors whatsoever
  2. ServerScriptService
  3. ModuleScript:
Function = function(plr,args)    -- Function to run for command
			local set = string.lower(args[1])
			
			if set == "off" then
				game.ReplicatedStorage.Restaurant.TableCount:FireClient(plr, "off")
			elseif set == "on" then
				game.ReplicatedStorage.Restaurant.TableCount:FireClient(plr, "on")
		else
				error("Invalid Entry")
			end
			
		end
	```

LocalScripts can’t run in ServerScriptService, hence the name ServerScriptService, which is intended to be where you would house ServerScripts. Here’s some places where local scripts can run:

  • Player’s Backpack , such as a child of a Tool
  • A Player’s character model
  • A Player’s PlayerGui
  • A Player’s PlayerScripts .
  • The ReplicatedFirst service
2 Likes

Thank you! I just put it in there in confusion because I didn’t exactly know the whole thing worked. Turns out A Player’s PlayerScripts is the appropriate place to put it