I have a GUI in StarterGui that has a sound. When you touch a certain block, a script in that block sets the SoundId and resets the TimePosition to 0.
The problem is that the TimePosition is not being set.
The script is a normal script.
Part = script.Parent
function onTouch(hit)
if hit.Parent == nil then return end
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
local player = game.Players[hit.Parent.Name]
local gui = player.PlayerGui.Music
gui.Sound:Stop()
gui.Sound.SoundId = "rbxassetid://idgoeshere"
gui.Sound:Play()
gui.Sound.TimePosition = 0
end
end
door.Touched:connect(onTouch)
How should I go about fixing this?