The simple way to change scene:
var targetScene = "res://Levels/NextLevelScenePath.tscn" # note: It's String
The real question is about when to use the above codes.
It based on what effects you want to show.
I mean if you want a effects like:
player pig eat truffle -> truffle disspear -> do effects you want -> change to new scene.
Suppose you just have one(unique) truffle to eat.
Then you can code like following:
(if there are lots truffles then you can check the quantity, if got enough quantity then change scene, else queue_free the truffle.)
[In truffle script]
var targetScene = "res://Levels/NewScenePath.tscn"
if get_overlapping_bodies().size() > 0:
visible = false # hide truffle
# do effects you want
Hope this help.