also call that line after the Boothtext is set or else it’s going to do nothing
I mean this line right here
1 Like
u need that piece on server bcuz it only works on server
Oh yeah, forgot nil only works for object values.
You get what I’m saying though. But essentially, check if there’s text, if there is, change the booth text.
Client:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local ChatService = game:GetService("Chat")
local RemoteEvent = game.ReplicatedStorage.BoothEvent
local BoothGui = game.StarterGui.BoothGui
local LocalPlayer = Players.LocalPlayer
local PlayerBoothGui = LocalPlayer.PlayerGui:WaitForChild("BoothGui")
local SubmitButton = PlayerBoothGui.Frame.SubmitButton
local CloseButton = PlayerBoothGui.Frame.CloseButton
local TextBox = BoothGui.Frame.Frame.TextBox
local BoothText = game.Workspace.Booth.Header.SurfaceGui.Frame.TextLabel.Text
RemoteEvent.OnClientEvent:Connect(function()
PlayerBoothGui.Enabled = true
PlayerBoothGui.Frame.BackgroundTransparency = 0
end)
game.ReplicatedStorage.ChatEventFilter.OnClientEvent:Connect(function(player, boothText)
BoothText = boothText
if PlayerBoothGui.Enabled == true then
PlayerBoothGui.Enabled = false
print("Text Changed")
end
end)
SubmitButton.MouseButton1Click:Connect(function()
if TextBox.Text ~= "" then
game.ReplicatedStorage.ChatEventFilter:FireServer(TextBox.Text)
end
end)
CloseButton.MouseButton1Click:Connect(function()
if PlayerBoothGui.Enabled == true then
PlayerBoothGui.Enabled = false
end
end)
Server:
game.ReplicatedStorage.ChatEventFilter.OnServerEvent:Connect(function(player, BoothText)
if BoothText ~= "" then
local messageSuccess, messageResult = pcall(function()
return textService:FilterStringAsync(BoothText, player.UserId):GetNonChatStringForBroadcastAsync()
end)
if messageSuccess == true then
game.ReplicatedStorage.ChatEventFilter:FireClient(player, BoothText)
end
end
end)
I dont know if this will work, because i dont know exactly how your Code works.
Also i see, the Text changes what u do, just you will see that.