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

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

Asked by 4 years ago

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?

0
Make effort to post your own code as well. SilentsReplacement 468 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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!

Ad

Answer this question