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

how do i make a sound play when i turn into a morph?

Asked by 3 years ago

i've tried multiple tutorials, but they don't seem to work at all.

1 answer

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

Im going to assume that when you touch a part, you will morph. To do this you will need a remote event in replicatedstorage and 1 localscript and 1 normal script!

-- normal script
local part = workspace.Part
local remoteEvent = game.ReplicatedStorage.RemoteEvent

part.Touched:Connect(function(touchedmorph)
    if touchedmorph.Parent:FindFirstChild("Humanoid") then
        remoteEvent:FireAllClients()
end


-- localscript
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")

local function playsound()
-- search a tutorial on how to play a sound using script and insert it here!
end
remoteEvent.OnClientEvent:Connect(playsound)

Any questions? Just ask!

Ad

Answer this question