Hello fellow lua developers,
I’ve been busy for some time to get the position to update and give it to the sound.PlayURL. The main problem I have is that it does call it correctly but the sound doesn’t move with the entity when the entity moves.
function ENT:Think() entpos = self:GetPos() end function PlayRadio (station, entpos) sound.PlayURL ( "http://yp.shoutcast.com/sbin/tunein-station.pls?id=7540&play_status=1" , "play 3d", function( station ) if ( IsValid( station ) ) then station:SetPos( entpos ) station:Play() station:SetVolume( 1 ) else LocalPlayer():ChatPrint( "Something is wrong with the channel." ) end end) end
As an error I get that entpos is no Vector but an string but how is it an string. When I print entpos then entpos is an vector.
I am totally lost, and sadly no idea on how to fix this. Hopefully someone can help me.