✓ Accepted answer
you can try this
Add a remote event called "NPCPrint" or whatever you would like to the replicatedstorage.
game.Workspace.Part.Touched:Connect(function(Hit)
if Hit.Parent.Name = "MyNPC" then
print("MyNPC touched my párt")
game.ReplicatedStorage.NPCPrint:FireAllClients()
script.Disabled = true
wait(10)
script.Disabled = false
end
end)
Then, go to StarterPlayer > StarterPlayerScripts. In there, add a LocalScript, type the following:
game.ReplicatedStorage.NPCPrint.OnClientEvent:Connect(function()
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "The NPC has touched the part!"
Color = Color3.fromRGB(0,0,0)
Font = Enum.Font.GothamBold
TextSize = 18
})
end)
I think we are done!
Hope it helps.
2 comments
Now it gives me the error in the local script: Error:(4,3) Expected '}' (to close '{' at line 2), got 'color'
i did some editing and now it works thank you