You know how cars play startup chimes when you start them? I'm trying to make that happen when you touch the car's driving seat in my game. I hadn't the slightest idea how to do that, so I morphed together two scripts I found on here, but they don't work, maybe because they're out of date? Idk. Please comment any suggestions below.
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local plrgui = player.PlayerGui
print(player)
local sound = script.Parent.Sound
sound:Clone().Parent = plrgui
sound:Play()
end
end)

1 comment
Use a local script or an even to FireClient(player) and OnClientEvent()