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

Does anybody know how to make a part talk when you press a button?

Asked by 5 years ago
Edited 5 years ago

To go more in-depth, I want to be able to press a button, to make a different part speak, that I could press somewhere else. Like from a one-sided window, and make a camera speak. Anybody know how?

function onClicked()
    script.Parent.Parent.Papers
game:GetService("Chat"):Chat(Part.Character,'PAPERS, PLEASE')
end

I tried my best but it still doesn't work...

1 answer

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

Okie, here's what you need to do I think:

local PartSpeaker = game:GetService("Chat")
local ClickDetector = script.Parent.ClickDetector

function onClick()
     PartSpeaker:Chat(script.Parent.Parent.ChatPart, "PAPERS, PLEASE")
end

ClickDetector.MouseClick:connect(onClick)

Insert two parts into Workspace, then insert this script into one of the parts. Name the other part "ChatPart". Go here to test it out: https://www.roblox.com/games/3899945240/Test-for-Scripting-Helpers-Answer

0
Thank you so much! I really appreciate it! satrasatra 8 — 5y
Ad

Answer this question