Hey, I’m trying to make a sign have editable text although this error shows in the output while running.
Error:
ServerScript:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local EditEvent = ReplicatedStorage.Events:FindFirstChild("EditEvent")
local UpdateText = ReplicatedStorage.Events:FindFirstChild("UpdateText")
local ChatService = game:GetService("Chat")
UpdateText.OnServerEvent:Connect(function(Player, SText)
if type(SText) ~= "string" then warn("signText argument not a string") end
local FilteredText;
pcall(function() FilteredText = ChatService:FilterStringForBroadcast(SText, Player)
end)
if FilteredText then
UpdateText:FireAllClients(Player, FilteredText)
end
end)
LocalScript:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local EditEvent = ReplicatedStorage.Events:FindFirstChild("EditEvent")
local UpdateText = ReplicatedStorage.Events:FindFirstChild("UpdateText")
local Sign = game.Workspace:FindFirstChild("Sign")
local SignText = Sign.Structure.Signs.TextSign.SurfaceGui:FindFirstChild("Text")
local EditPrompt = Sign.Structure.Prompt:FindFirstChild("Edit")
local EditFrame = Players.LocalPlayer.PlayerGui.Edit:FindFirstChild("Frame")
local Close = EditFrame.Buttons:FindFirstChild("Close")
local Apply = EditFrame.Buttons:FindFirstChild("Apply")
local Text = EditFrame.Buttons:FindFirstChild("Text")
EditEvent.OnClientEvent:Connect(function()
EditFrame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Sine", 0.5, true)
end)
Close.MouseButton1Down:Connect(function()
EditFrame:TweenPosition(UDim2.new(0.5, 0, -1, 0), "Out", "Sine", 0.5, true)
EditPrompt.Enabled = true
end)
Apply.MouseButton1Down:Connect(function()
UpdateText:FireServer(Text.Text)
end)
UpdateText.OnClientEvent:Connect(function(SText)
SignText.Text = SText
EditFrame:TweenPosition(UDim2.new(0.5, 0, -1, 0), "Out", "Sine", 0.5, true)
EditPrompt.Enabled = true
end)
