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

Message is not appearing in workspace?

Asked by 2 years ago

the message wont appear in workspace

local deBounce = false
local playerFrom = game.Players.LocalPlayer
local ChatService = game:GetService("Chat")
script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") == true then
        ChatService.Chatted:Connect(function(message)
            deBounce = true
            local FilteredString = game:GetService("Chat"):FilterStringForBroadcast(message, playerFrom)
            local Message = Instance.new("Message")
            Message.Parent = workspace
            Message.Text = FilteredString
            wait(3)
            deBounce = false
            Message.Parent = nil
            Message.Text = ""
        end)
    end
end)
0
You need to do this on a server script if I'm right, the 8th line fails I think. enes223 327 — 2y
0
It is on a server script Yodadthin 2 — 2y
0
Accessing the LocalPlayer isn't possible on a ServerScript, only LocalScripts. Y_VRN 246 — 2y

Answer this question