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

Audio Breaks When Player Goes Into First Person View?

Asked by 6 years ago

So I got help from here to make this local script. It is under PlayerGui however, when the player is in first person camera view while touching the brick, the audio literally breaks. Why?

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local part = game.Workspace.Stores.GeneralStore.GeneralStoreMusic

part.Touched:Connect(function(hit)
    if hit.Parent == player.Character  then
        player.PlayerGui.Music.GeneralStoreMusic:Play()
    end
end)

part.TouchEnded:Connect(function(hit)
    if hit.Parent == player.Character then
        player.PlayerGui.Music.GeneralStoreMusic.Playing = false
    end
end)

0
Line 13 change GeneralStoreMusic:Stop() ? User#19524 175 — 6y
0
You want it so when the player touches the `part`, the music plays and when the player stops touching the `part`, the music will stop? hellmatic 1523 — 6y
0
The script works, however when the player is in first person camera view, the audio doesn't play... BunnyFilms1 297 — 6y
0
It's probably a bug, try printing when the touchended event fires: print('touch ended'), and see that if you zoom in, it prints hellmatic 1523 — 6y
View all comments (2 more)
0
tell me if it does or not hellmatic 1523 — 6y
0
It does print when the touch is ended whenever the camera moves around in first person view. BunnyFilms1 297 — 6y

Answer this question