Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function spawnice(inst)
- inst:DoTaskInTime(0, function(inst)
- inst.SoundEmitter:PlaySound("dontstarve/common/teleportato/teleportato_powerup", "teleportato_on")
- end)
- inst:DoTaskInTime(1, function() onopen(inst)
- end)
- inst:DoTaskInTime(1.5, function(inst)
- local ice = SpawnPrefab("ice")
- local ice2 = SpawnPrefab("ice")
- local ice3 = SpawnPrefab("ice")
- local pt = Vector3(inst.Transform:GetWorldPosition()) + Vector3(0,2,0)
- ice.Transform:SetPosition(pt:Get())
- ice2.Transform:SetPosition(pt:Get())
- ice3.Transform:SetPosition(pt:Get())
- local down = TheCamera:GetDownVec()
- local angle = math.atan2(down.z, down.x) + (math.random()*60)*DEGREES
- local sp = 3 + math.random()
- ice.Physics:SetVel(sp*math.cos(angle), math.random()*8+12, sp*math.sin(angle))
- ice2.Physics:SetVel(sp*math.cos(angle), math.random()*6+12, sp*math.sin(angle))
- ice3.Physics:SetVel(sp*math.cos(angle), math.random()*12+8, sp*math.sin(angle))
- end)
- inst:DoTaskInTime(2, function() onclose(inst)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement