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

Chatted event script works in output but won't pop up in game?

Asked by 6 years ago
Edited by User#5423 6 years ago

I have a chatted event script which when you say "yes" it will say "it's lonely, should sit with it." back. I see that it's putting the text in the 'output' but I want it to like pop up on screen then disappear.

This is the script (it's in the ServerScriptService) V V

game:GetService("Players").PlayerAdded:connect(function(Player)
    Player.Chatted:connect(function(Message)
        if Message == "yes" then
            print("It's lonely, should sit with it?")
        end
    end)
end)
0
Use Lua brackets around code DinozCreates 1070 — 6y
0
What code? The whole script? I did that, then tested it, but the whole chat bar disappeared. Aprilsaurus 48 — 6y
0
Edit:- code block User#5423 17 — 6y
0
Oh, thanks for doing that :) now people can see the script. Thank you :D Aprilsaurus 48 — 6y
0
Does my solution fix the problem> TinyAyush 58 — 5y

1 answer

Log in to vote
0
Answered by 6 years ago

You can't do Player.Chatted in an actual script since it doesn't have the level of permission to do so, but the command line does, so, you have to use an event in the service, 'game.Players'; game.Players.PlayerChatted.

Here's how you can do it:

game.Players.PlayerChatted:Connect(function(Player, Message)
    --// Code here
end)
0
Hopefully this helped. TinyAyush 58 — 6y
Ad

Answer this question