Im trying to dynamicly change the src of this script

Code:
<script 
    type="text/javascript" 
    src="https://api.twitch.tv/kraken/streams?game=DayZ&limit=4&offset=0&callback=showGame">
</script>
But ive been googling it and cant seem to find the proper syntex to write it dynamically.. i haven't even started using the variable... just trying to get the syntex to write it first... the ultimate goal will be to change the offset value inside the src

this is what I found browsing the web but it does not work

Code:
<script>
document.write("<script type="text/javascript" src="https://api.twitch.tv/kraken/streams?game=DayZ&limit=4&offset=0&callback=showGame<\/script>");
</script>
is it a syntax issue or am i taking the completely wrong approach?

If this did work i was going to go with something like

Code:
<script>
var variable = (source for my variable)
document.write("<script type="text/javascript" src="https://api.twitch.tv/kraken/streams?game=DayZ&limit=4&offset=" + variable + "&callback=showGame<\/script>");
</script>