Hi, I'm currently stuck on a problem that I can't figure out myself. I want the localscript to play a sound locally whenever a player enters the car. The script looks for when a child is added into the "DriveSeat" and detects whether it is a "Weld" or not. If it is a "Weld" then it should play a specific sound. All sounds are under the drive seat and the script is a localscript as I mentioned before. The car chassis is Inspare SS3. Anyway, here is the script I'm working with, it's fairly simple.
local carSeat = script.Parent script.Parent.ChildAdded:connect(function(child) if child:IsA("Weld") then carSeat.Startup:Play() wait(1) carSeat.Chime:Play() end
LocalScript
is a child of a BasePart
. Sad to say, that LocalScript
objects can only run if under one of the following:Backpack
PlayerGui
PlayerScripts
Player
’s Character
ReplicatedFirst
service.SoundService:PlayLocalSound(Sound)
to play a sound locally.