I am a novice at Lua & Scripting, Could anyone help me?
local sound = script.Parent.Sound --The sound object to play script.Parent.Touched:connect(function(p) --When the parent part is touched local human = game.Players:GetPlayerFromCharacter(p.Parent) --Check touching part is part of a Player character if human and not sound.IsPlaying then --If player and the sound isn't already playing sound:Play() --Play the sound end end)
Be sure to name the sound/music Sound, or to edit the script with the name.
Both the script & sound should be inside the part.
try this
script.Parent.Touched:Connect(function(c) game.Workspace.Sound:Play()