Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i make a Chat message for the server appear when a player touches a brick?

Recently I have been trying to make a server message appear in the roblox chat bar when a player touches a brick. Can anybody help me with this?

1 comment

0

Make effort to post your own code as well.

1 answer

Easy. Insert a BinableEvent in ReplicatedStorage and insert a script into ServerScriptService for the event listener and insert a script into the part for the touched event.

Script for the part:

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then -- Checks to see if a humanoid has touched part..
game.ReplicatedStorage.BindableEvent:Fire() 
end
end)

The script inside the ServerScriptService:

game.ReplicatedStorage.BindableEvent.Event:Connect(function()
         color = "Really red"  -- Color for the text
         game.StarterGui:SetCore("ChatMakeSystemMessage")
        Text = "This is a test" -- Change the text to what you want the chat to say.
         Font = Enum.Font.Gotham -- Font for the text
         FontSize =  Enum.FontSize.Size96
end)

Note that these are global variables..

Please make sure to select this as your answer if it helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.