Tool Sign gets editable by everyone

I have a Tool Sign that supposedly edits for one person only who has it, apparently whenever I enter it goes on edits for all of the signs that everyone have.

Can anyone point out where did I went wrong? :sob:

This is how it looks for the Tool itself.
image

This is where the GUI is for Local Player:
image

The script is just small, but I use a RemoteEvent. I also used RemoteFunction which works as well however sends to different people that owns the sign. :sob:

Server Script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local Event = ReplicatedStorage:WaitForChild("ChangeTextSign")

Event.OnServerEvent:Connect(function(player, text)
	local TextSign = script.Parent
	local Filter = Chat:FilterStringForBroadcast(text, player)
	
	TextSign.Text = Filter
end)

localScript:

local rs = game:GetService("ReplicatedStorage")
local Event = rs:WaitForChild("ChangeTextSign")
local SignText = script.Parent.Parent.TextBox

SignText.FocusLost:Connect(function()
	local Text = SignText.Text

	Event:FireServer(Text)
end)
2 Likes

You could just put the RemoteEvent in the tool itself only, or you can do a check on the server to see if the player that has equipped the sign is the same as the player who sent the event. This can be done as so:

local tool = script.Parent -- or .Parent, whereever tool is basically.
-- Event recieved function
local ourPlayer = game.Players:GetPlayerFromCharacter(tool.Parent)
if player == ourPlayer then
-- Run the TextSign changes.
3 Likes

I tried doing the Check on the Server, and it didn’t work. I tried putting it inside the OnServerEvent function.

Also, as for putting the RemoteEvent inside the tool itself, won’t that take much longer to detect where the heck the Remote Event will be? :sob: If its possible, can you tell me how it is?

For the most parts, this is what I did inside the server script

Event.OnServerEvent:Connect(function(player, text)
	print("Detecting player...")
	if player == MainPlayer then
		print("Player"..MainPlayer.."Detected!")
		local TextSign = script.Parent
		local Filter = Chat:FilterStringForBroadcast(text, player)
		print("Filtering...")

		TextSign.Text = Filter
		print("Filtered!")
	end
end)

it only prints Detecting Player and it doesn’t proceed any longer than that

It won’t. How are you saying it would be? Just put the remoteevent in the tool.

Maybe MainPlayer is something else?

apparently, it didn’t took me that long to alter the Script for putting the RemoteEvent inside the Tool, I’ll test this out with out people in a bit and see if it still affects others. Thanks for the help, will post here again in a bit.

Turn off TextEditable from the server either from the property tab or in the script. Enable it from the localscript

What does TextEditable do? I already turned them off in Gui, so whenever the Tool gets equipped it gets enabled.

Allows players to edit the textbox
So enable it in the localscript

It seems that you misunderstood the issue. Here, let me break it down for you;

OP is having an issue where the remote event fires unwantingly to the rest of the sign tools in other player’s inventory thus causing those signs to also get altered. Setting the TextEditable property to false would do nothing.

That’s good to hear. Let me know what happens and I’ll try to assist you.

Ah in which case put the script in the serverscriptservice and fire the tool instance as a parameter in the remoteevent

That too is an option but in this case, putting the remote event in the tool would be much easier.

Yup, that actually helped and I’ve tested it with other people already so its a great help.

However, whenever someone respawns, I can’t edit the sign no more and therefore had to rejoin for it to rework again.

Is the screenguis RestOnSpawn enabled or not?

1 Like

the screengui’s resetonspawn is toggled off

Actually the screenGui doesn’t have for ResetOnSpawn to be toggled on or off.

What I actually have problem with is whenever I respawn, its not detecting the the Tool again.

Is the textgui parented under the tool?

also bare in mind that tools are only parented under the character when equipped.

Yes, that’s what I did. Also, I really need to rest for the mean time, its 3AM currently, I’m really sorry I’ll check back in with you guys later.

omg lmao, I just checked ResetOnSpawn on the StarterGui and its working. What an easy fix I couldn’t see :sob: thanks everyone for the help <3

Toggle it On then. Or else it won’t work.

If it works then please mark one of our posts as the solution so people know that this post has been solved. Maybe mark mine as the solution or SkrubDaNub’s post.