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?
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!