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

Can someone help I am trying to make remote event play music on touch?

Asked by 5 years ago
Edited 5 years ago

--local script

local Music = game.ReplicatedStorage.Music

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local function Musicer(player, Musics)

script.Playing.Value = Musics -- then add meaning to the variable

if(script.Playing.Value == true)then

    script.Playing.Value = false

    script.Sound:Play()

end

end

Music.OnClientEvent:Connect(Musicer)

--Script

local RP = game.ReplicatedStorage

local Music = RP:WaitForChild("Music")

script.Parent.Touched:Connect(function(hit)

if(hit.Parent:WaitForChild("Humanoid"))then

    local player = game.Players:GetPlayerFromCharacter(hit.Parent)

    Music:FireClient(player, script.Playing.Value)

end

end)

There is no error is that it is not working either.

0
it is suppose to play once someone touched it but it plays for only the player that touched it vortex767 20 — 5y
0
I like big bobs too greatneil80 2647 — 5y

Answer this question